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

前端 未结 4 427
生来不讨喜
生来不讨喜 2020-12-14 01:45

I am using sitemesh to decorate the pages. I am using a JSP page for this. The page worked fine until I used the conditional tag. I have the jstl-i

相关标签:
4条回答
  • 2020-12-14 02:00

    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

    0 讨论(0)
  • 2020-12-14 02:02

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

    0 讨论(0)
  • 2020-12-14 02:07

    From Netbeans IDE

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

    That you will fire it.

    0 讨论(0)
  • 2020-12-14 02:22

    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:

    • Our JSTL wiki page
    0 讨论(0)
提交回复
热议问题