1

I searched several other threads on this error, most of them either had the wrong/missing maven dependency or had the wrong uri in their taglib.

As far as I know, I've got everything correct and my app keeps failing once I get to the jsp where I use JSTL.

This is the taglib I'm using:

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

And these are my maven dependencies

<dependencies>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

As far as I know, from the servlet api 2.4 on you need jstl 1.2, which I have, so I really don't see the problem here...

EDIT: I see this question has been marked as a duplicate, though it isn't. The referring question was solved by fixing the uri of the taglib, here it was a case of adding jstl to tomcat's lib folder

Robin-Hoodie
  • 4,886
  • 4
  • 30
  • 63

3 Answers3

3

I added jstl-1.2.jar to my tomcat/lib folder. As tomcat doesn't have the jstl jar and by putting my scope on provided I had to make sure my container (tomcat) had the relevant jar available.

Though I haven't tested it, this should also work by leaving the jstl jar on the default compile scope

Robin-Hoodie
  • 4,886
  • 4
  • 30
  • 63
1

Try this one from mvnrepository

<dependency>
    <groupId>jstl</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
</dependency>

Read similar post here


Update the version

 <dependency>
     <groupId>javax.servlet</groupId>
     <artifactId>javax.servlet-api</artifactId>
     <version>3.1.0</version>
 </dependency>
Community
  • 1
  • 1
Braj
  • 46,415
  • 5
  • 60
  • 76
  • Find similar post [here](http://stackoverflow.com/questions/24391687/absolute-uri-http-java-sun-com-jsp-jstl-core-cannot-be-resolved-in-either-web/24392190#24392190) as well. That works. – Braj Jul 12 '14 at 13:26
  • It has the exact same answer you gave me – Robin-Hoodie Jul 12 '14 at 13:27
  • read the question as well of the shared links. try with updated version of the javax.servlet-api – Braj Jul 12 '14 at 13:28
  • clean the project and click to maven update project. Look in the repository that jar is present or not with the corrected version. Check whether dependencies is resolved or not. – Braj Jul 12 '14 at 13:31
  • Tried it, the jar is there with the right version, dependencies are resolved, still fails :( – Robin-Hoodie Jul 12 '14 at 13:55
0

Use :

<dependency>
    <groupId>javax.servlet.jsp.jstl</groupId>
    <artifactId>jstl-api</artifactId>
    <version>1.2</version>
</dependency>

javax.servlet moved to above.

user3145373 ツ
  • 7,858
  • 6
  • 43
  • 62