maven工程引入jstl,且出现uri异常的解决

来源:互联网 发布:java log4j2.xml 编辑:程序博客网 时间:2024/05/22 13:17

pom.xml中加入

<dependency>

<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
然后在Jsp界面引入
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!--输出,条件,迭代签标库-->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="fmt"%> <!--数据格式化标签库-->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="sql"%> <!--数据库相关标签库-->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="fn"%> <!--常用函数标签库-->
<%@ page isELIgnored="false"%> <!--支持EL表达式,不设的话,EL表达式不会解析-->
如果使用的是1.0的包,url改为:http://java.sun.com/jstl/core
异常:

HTTP Status 500 - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

1,maven中的pom.xml中未引入jstl和standard包,或者jsp界面的URI写错了
2,tomcat缺少包,将jstl.jar包复制到tomcat目录中的lib文件夹中即可



阅读全文
0 0