MyEclipse: JSTL 1.2 + Servlet 3.0 + Tomcat 7 = NIghtmare

curmudgeon99 - May 20, 2012 - 03:52 PM
Post subject: JSTL 1.2 + Servlet 3.0 + Tomcat 7 = NIghtmare
Using MyEclipse 10.1

Have defined my project's web.xml

Code:

<web-app
     xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
     version="3.0">


Have NO tld defined in web.xml

Have downloaded the glassfish API and IMPL for JSTL 1.2 (Servlet 3.0 compliant), with these Maven dependencies and also in the MyEclipse project to make Eclipse happy. But notice they are given a scope of <provided>. If I don't do that, Tomcat 7 complains of LinkageExceptions.

Code:

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>org.glassfish.web</groupId>
    <artifactId>javax.servlet.jsp.jstl</artifactId>
    <version>1.2.1</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>javax.servlet.jsp.jstl</groupId>
    <artifactId>javax.servlet.jsp.jstl-api</artifactId>
    <version>1.2.1</version>
    <scope>provided</scope>
</dependency>


Have the following statement at the top of the JSP:

Code:

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


Note this is the allegedly correct path for JSTL 1.2

At this point, MyEclipse makes no complaints.
There are no other JSTL jars in the Tomcat 7 lib or in my WEB-INF/lib directory.

When I hit the page that has the JSPs, I get this exception:

Code:

org.apache.jasper.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


What am I doing wrong? Any ideas?
support-swapna - May 22, 2012 - 07:34 AM
Post subject:
curmudgeon99 ,

Sorry that you are seeing this issue.

Can you please check these links ? :

http://stackoverflow.com/questions/4928271/jstl-1-2-the-absolute-uri-http-java-sun-com-jstl-core-cannot-be-resolved
http://stackoverflow.com/questions/2427486/org-apache-jasper-jasperexception-the-absolute-uri-http-java-sun-com-jsp-jst

I suggest you also cross post to development forums for better support.
support-joy - May 22, 2012 - 07:56 AM
Post subject:
curmudgeon99,

You need to get the right version of JSTL, they use different URIs. Check if you have jstl-api.jar and jstl-impl.jar in your project build path? If not, please add the same. I think you need to use JSTL version 1.2. You could download the same from here - http://jstl.java.net/download.html
curmudgeon99 - May 27, 2012 - 01:29 PM
Post subject:
support-joy wrote:
curmudgeon99,

You need to get the right version of JSTL, they use different URIs. Check if you have jstl-api.jar and jstl-impl.jar in your project build path? If not, please add the same. I think you need to use JSTL version 1.2. You could download the same from here - http://jstl.java.net/download.html


Joy,
Thank you for attempting to help me but do you see the Maven dependencies?
Please notice that I refer to version 1.2.1 of those precise dependencies you mention.
I can assure you they exist on my classpath. Did you not see that I mention those two precise JARs you asked if I have?
All times are GMT - 6 Hours
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits