javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/ConditionalTagSupport

五迷三道 提交于 2019-11-28 19:15:11
BalusC

This exception suggests that the JSTL API is missing in the runtime classpath. You seem to have only the JSTL impl. I suggest to remove it and use jstl-1.2.jar instead which has both the API and impl bundled.

Further, I'd also recommend to update your web.xml root declaration to comply Servlet 3.0 spec. JSTL 1.2 requires a minimum of Servlet 2.5, so it won't work very well with a Servlet 2.4 targeted project. As Tomcat 7 is a Servlet 3.0 container and Servlet 3.0 offers a lot of new cool features over 2.5, I'd go for it.

<web-app 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    version="3.0">

Don't forget to fix your dynamic web project facet version in project's properties accordingly.

See also:

maybe you must add also the javax.servlet.jsp.jstl-api-1.2.x.jar to your classpath. You're only declaring a specific implementation, without the core API. I had the same problem and I solved in this way. Regards, Giacomo

JSTL lib may be missing check both jstl and servlet jars.

From Netbeans IDE

Right click on a project, then presses, libraries and add just a library

That you will fire it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!