The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application [duplicate]

泄露秘密 提交于 2019-11-28 00:19:07
BalusC

Your taglib URI is wrong.

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

This URI is from the old and EOL'ed JSTL 1.0 library. Since JSTL 1.1, you need an extra /jsp in the path because the taglib's internal workings were changed because the EL part was moved from JSTL to JSP:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

Further, the JAR files which you attempted to drop in /WEB-INF/lib are wrong. The javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar is contains only the JSTL javadocs and the javaee.jar contains the entire Java EE API which may be desastreus because Tomcat ships with parts of it already (JSP/Servlet) which may conflict.

Remove them all. You need the jstl-1.2.jar file.

See also:

I think you should include jstl impl jar. Here is one location of the jar i found:

JSTL Impl jar

Also, instead of

<c:if test="${session.getAttribute('logged')!=null}">  

use one of the following

<c:if test="${sessionScoped.logged != null}">  
<c:if test="${sessionScoped[logged] != null}">
<c:if test="${logged != null}">
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!