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

0

3 Answers 3

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

Sign up to request clarification or add additional context in comments.

Comments

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>

5 Comments

Find similar post here as well. That works.
It has the exact same answer you gave me
read the question as well of the shared links. try with updated version of the javax.servlet-api
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.
Tried it, the jar is there with the right version, dependencies are resolved, still fails :(
0

Use :

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

javax.servlet moved to above.

1 Comment

Have you tried by changing servlet from 2.5 to 3 ? try it, if not solve then post me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.