facebook

JSTL 1.2 + Servlet 3.0 + Tomcat 7 = NIghtmare

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #326207 Reply

    curmudgeon99
    Participant

    Using MyEclipse 10.1

    Have defined my project’s web.xml

    
    <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.

    
    <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:

    
    <%@ 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:

    
    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?

    #326251 Reply

    support-swapna
    Moderator

    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.

    #326252 Reply

    support-joy
    Member

    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

    #326399 Reply

    curmudgeon99
    Participant

    @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?

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: JSTL 1.2 + Servlet 3.0 + Tomcat 7 = NIghtmare

You must be logged in to post in the forum log in