• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in executing JSTL

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My test JSP contains
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<body>
<b>Tip of the Day</b><br><br>
<c:out value='${param.test}' escapeXml="true"/>
</body>
</html>

I added two jar files(jstl.jar and standard.jar) as defined in my lib folder and also to my classpath.


When i am trying to execute the JSP i am getting following error:
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
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
JstlTest1.doGet(JstlTest1.java:43)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Please help.

Thanks,
Shivey



 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure that you used the correct versions of the JSTL jar files?
 
Shivey Upadhyay
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I took the jars from
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\jsp-examples\WEB-INF\lib
as defined in Head First Servlet book.
Please let me know what's wrong from my side.

Thanks,
Shivey
 
Ranch Hand
Posts: 826
Eclipse IDE Oracle Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have got the correct version of JSTL.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Shivey Upadhyay:
I added two jar files(jstl.jar and standard.jar) as defined in my lib folder and also to my classpath.


Please extract them using some zip tool and read the manifest file to find out version details.

Also please tell where exactly that lib folder is.

Also please elaborate what you mean with "also to my classpath". Did you mean the %CLASSPATH% environment variable or so? There's no need to do so in case of a webapplication. Just place the JAR's in /WEB-INF/lib, it's already covered by the webapp's classpath.
[ December 25, 2008: Message edited by: Bauke Scholtz ]
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bauke Scholtz:
Please extract them using some zip tool and read the manifest file to find out version details.


This extraction is only for diagnostic purposes. Do not put any extracted pieces in your web application. A lot of people seem to cause themselves a lot of needless grief by extracting the TLD files and putting them in their apps. Don't do that!
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Indeed. You need to find out which JSTL version exactly it is. Then you can find in the appropriate TLD documentation how the taglib URI look like. The chance is there that you're using JSTL 1.0 which has a slight different taglib URI than which you're using now (which is only valid for JSTL 1.1 and 1.2).
 
Shivey Upadhyay
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Thanks for your replies. I extracted the MANIFEST.MF file and found the version is: JSTL 1.1. And the URI is given there in TLD for for different Tags, i will use it and i suppose that should work.

Thanks again,
Shivey
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Uh, one moment please, the URI is right for JSTL 1.1. You shouldn't be using the _rt URI's.

The problem lies somewhere else. Please answer my other two questions.
 
Shivey Upadhyay
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Sorry for late replies!
I didn't get your questions, if you could repeat them.

Thanks,
Shivey
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please , for more details about jstl version go to the jspFaq (find in my signature EL or JSTL problem )
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic