Jakarta JSTL Tomcat

Viewed 788

I am developing a web application in IntelliJ with Java/Jakarta, Maven and Tomcat 10. Therefore I want to use the JSTL Tags, but can't get them to work.

Through Maven I've added org.glassfish.web:jakarta.servlet.jsp.jstl:2.0.0. to my project. I've also added the jar file in the Tomcat/lib folder.

In the jsp file I've added:

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

To solve the problem "The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application" I've added the dependency in my pom.xml

<dependency>
 <groupId>org.glassfish.web</groupId>
 <artifactId>jakarta.servlet.jsp.jstl</artifactId>
 <version>2.0.0</version>
</dependency>

Now I'm having the following problem:

java.lang.NoClassDefFoundError: jakarta/servlet/jsp/jstl/core/LoopTag

Thank you for your time :)!

1 Answers

The jakarta.servlet.jsp.jstl-2.0.0.jar and jakarta.servlet.jsp.jstl-api-2.0.0.jar files don't go in the Tomcat/lib folder.

They should be put into the WEB-INF/lib folder in the .war file.

Related