I have read through nearly every answer to this question on SO and have tried over a dozen different "solutions" but I cannot get JSTL to work in a Spring boot web app using servlet 3.1 within Tomcat 8.0. I continue to receive this error:
The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application.
I use Maven to build the project but have also manually copied JARs as well in hopes that would help but alas, it has not! I hope I am just overlooking something stupid. Can someone please tell me what I am doing wrong??
Things I have tried (for all of these, this is the included line in a simple index.jsp file -
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
Added the following dependency to my pom.xml (XML chars removed to format better)
<dependency> <groupId>javax.servlet.jsp.jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency>
This puts the jstl-1.2.jar in my WEB-INF/lib directory and I have confirmed it is there when I deploy to Tomcat - this doesn't work
Removed the above dependency and added these dependencies per the suggestion here (http://www.murraywilliams.com/2011/11/running-jstl-1-2-on-tomcat-7-using-maven/)
<dependency> <groupId>org.glassfish.web</groupId> <artifactId>jstl-impl</artifactId> <version>1.2</version> <exclusions> <exclusion> <artifactId>servlet-api</artifactId> <groupId>javax.servlet</groupId> </exclusion> <exclusion> <artifactId>jsp-api</artifactId> <groupId>javax.servlet.jsp</groupId> </exclusion> </exclusions> </dependency>
This puts two additional JAR files in my WEB-INF/lib directory, a jstl-api-1.2.jar and jstl-impl-1.2.jar, and I have confirmed they are there when I deploy to Tomcat - this doesn't work
I have also tried changing the scope to 'provided' for each of those dependencies while placing the respective JARs in Tomcat's lib directory and restarted Tomcat and still doesn't work.
Here is my web.xml header
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
Anyways, any help is greatly appreciated!