jabe
jabe

Reputation: 834

How to use JSTL 1.2 on Tomcat 8?

I want to use JSTL 1.2 in my Tomcat 8 web app. I continue to get JasperException: 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. None of the other answers on the internet solve this problem for me.

I have verified that the jstl-1.2.jar is in my web app's WEB-INF/lib folder and my JSP has the newer, <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> declared at the top.

If I open the jstl-1.2.jar file with 7zip, I can clearly see the c.tld file inside the META-INF folder and within that file I can even see this line: <uri>http://java.sun.com/jsp/jstl/core</uri>.

I am not using maven, just copying jars into the WEB-INF/lib folder as needed. My web-app's web.xml file specifies it is web-app version 3.1

What else can I do to troubleshoot this? Also, is there any modern documentation on using JSTL? Oracle's docs end up here, which has almost no details on using JSTL, or even how to get it.

Webapp structure:

enter image description here

Upvotes: 1

Views: 4260

Answers (1)

jabe
jabe

Reputation: 834

In my case, Tomcat's catalina.properties file had the jarsToSkip setting at \*.jar, so no jars would be scanned, resulting in quicker startup. To override this, I added taglibs*.jar (my jars were called taglibs-standard-impl-1.2.5.jar and taglibs-standard-spec-1.2.5, so it picked both up) to the jarsToScan setting below it, which fixed the problem.

I'm guessing that if jars aren't scanned, taglibs can't be found.

Tomcat's page has a nice write up of using taglibs here with a helpful readme.

Upvotes: 1

Related Questions