我刚开始接触jsp页面,昨天开了一个类似的讨论。这可能是重复的或非常相似的一个问题,如果是这种情况,我很抱歉。但是我只开发了几天jsp页面,还没有理解环境、文件夹等是如何"链接"在一起的。
我在Apache Tomcat 7上遇到了以下错误:
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
因为我包含了这个标签库。
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
然后,我在“WEB-INF”文件夹下创建了一个名为“lib”的文件夹,并将文件“jstl-1-2.jar”放在其中。 用户建议从这里进入另一个讨论 绝对uri:http://java.sun.com/jsp/jstl/core无法在web.xml或部署此应用程序的jar文件中解析 删除standard.jar,但我从未有过类似的文件。
阅读和浏览网页,我发现在Tomcat 7中,只需将jstl-1-2.jar放入以下位置的WEB-INF/lib文件夹中,但是无论有没有该文件,都没有任何反应。错误没有改变。
/var/lib/tomcat7/webapps/jsp_test/web/WEB-INF/lib/jstl-1-2.jar
这是文件夹三:
- webapps - ROOT - index.html
- META-INF - context.xml
- jsp_test - nbproject
- src - conf - MANIFEST.MF
- java - mypack - Display.java
- web - ROOT - index.jsp
- WEB-INF - lib -jstl-1.2.jar
- web.xml
- beans.xml
我注意到在tomcat 7文件夹中还有另一个web.xml文件:
/etc/tomcat7/web.xml
我需要在两个web.xml文件中改变什么吗?
此外,在tomcat7-example文件夹中查看,有一个web.xml文件,其中许多库都用.tld扩展名写入:
/usr/share/tomcat7-examples/examples/WEB-INF/web.xml
我迷失了方向,因为这个愚蠢的东西,请帮助我! :)