如何使用JSTL
- 在工程内部引入jstl.jar和standard.jar
- 在jsp页面或者web.xml引入标签。
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
可能发生的问题:
The absolute uri: http://java.sun.com/jstl/core cannot be resolved
Q:That URI is for JSTL 1.0, but you're actually using JSTL 1.2 which uses URIs with an additional /jsp path (because JSTL, who invented EL expressions, was since version 1.1 integrated as part of JSP in order to share/reuse the EL logic in plain JSP too). So, fix the taglib URI accordingly: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
意思是jstl对于1.0和1.2的引入链接是不同的,1.0的不带jsp,1.2新增了一层路径jsp
http://java.sun.com/jsp/jstl/core