是否需要在tomcat web.xml上配置JSTL库?(Does JSTL library need to be configure on tomcat web.xml? [duplicate])
这个问题在这里已有答案:
如何安装JSTL? 绝对的uri:http://java.sun.com/jstl/core无法解决 13个答案我正在为一个课程做一个java Web应用程序,它需要使用JSTL库; 所以我的问题是: 是否需要在tomcat web.xml上配置JSTL? 如果是这样,我该如何配置它? 我已经下载了jar文件; 我该把它放在哪里?
提前致谢!
This question already has an answer here:
How to install JSTL? The absolute uri: http://java.sun.com/jstl/core cannot be resolved 13 answersI'm doing a java web application for a coursework, and it is required the use of JSTL library; so my questions are: does JSTL need to be configured on tomcat web.xml? If so, how can I configure it? I have already downloaded the jar file; where do I have to put it?
Thanks in advance!
最满意答案
不,您不必在web.xml中定义它。
您应该将jar放入WEB-INF / lib并在jsp中声明它。 就像是:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>no, you don't have to define it in web.xml.
You should put the jar into your WEB-INF/lib and declare it in your jsp. something like:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>更多推荐
发布评论