是否需要在tomcat web.xml上配置JSTL库?(Does JSTL library need to be configure on tomcat web.xml? [duplicate])

编程入门 行业动态 更新时间:2024-10-27 08:27:43
是否需要在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 answers

I'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" %>

更多推荐

本文发布于:2023-08-07 15:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464726.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:xml   web   tomcat   JSTL   duplicate

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!