0

I am getting the error while hitting the home page.

java.lang.ClassNotFoundException: javax.servlet.jsp.tagext.TagLibraryValidator  

I have created one spring-boot project where in the home.jsp page I am using the tag

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

In pom.xml I have the below dependencies:

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>    
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>4.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
                <dependency>
                  <groupId>jakarta.servlet.jsp.jstl</groupId>
                  <artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
                  <version>2.0.0</version>
               </dependency>
               <dependency>
                  <groupId>org.glassfish.web</groupId>
                  <artifactId>jakarta.servlet.jsp.jstl</artifactId>
                  <version>2.0.0</version>
               </dependency>
    </dependencies>

I am using tomcat-10 to run the application.

3
  • Don't mix JSTL 1.2 with 2.0. Mixing different versions of API/impl makes no sense. See 1st abovelinked duplicate. Also note that Tomcat 10 is Servlet 5.0 not 4.0. See 2nd abovelinked duplicate.
    – BalusC
    Commented Mar 30 at 15:03
  • Hi @BalusC, "Also note that Tomcat 10 is Servlet 5.0 not 4.0. See 2nd abovelinked duplicate." - which dependency you mean?
    – dev D
    Commented Mar 30 at 15:32
  • Details are in accepted answer of 2nd duplicate.
    – BalusC
    Commented Apr 1 at 10:19

0

Browse other questions tagged or ask your own question.