Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in executing JSTL

 
Shivey Upadhyay
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • 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>
<cut 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



 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65340
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
sudipto shekhar
Ranch Hand
Posts: 826
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have got the correct version of JSTL.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Pie
Posts: 65340
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Hi,
Sorry for late replies!
I didn't get your questions, if you could repeat them.

Thanks,
Shivey
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please , for more details about jstl version go to the jspFaq (find in my signature EL or JSTL problem )
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic