在jsp文件中使用jstl时,由于jstl版本和分支众多,导入jar包时很容易出现这种错误:the absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar
解决方法:
若使用1.1.2版本,则应该在maven中导入以下2个jar包即可
<dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> </dependency>
链接分别为:
http://mvnrepository.com/artifact/javax.servlet/jstl/1.1.2
http://mvnrepository.com/artifact/taglibs/standard/1.1.2
jsp页面中taglib声明:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>