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

URI can't be resolved for JSTL

 
Vani Chinta
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use JSTL from chapter 9(custom tags are powerful) and placed jstl.jar in lib directory of WEB-INF.
With scripting everything is working fine but when I try to use forEach custom tag, I get the following error.

org.apache.jasper.JasperException: This absolute uri (http://java.sun.com/jsp/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application.

and on the tomcat console "Exception initializing TldLocationsCache: XML parsing error on file /WEB-INF/web.xml:<line 1,col 9>: Document is invalid: no grammer found." is displayed.

Here is my web.xml




<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>MovieList</servlet-name>
<servlet-class>com.example.web.taglibServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MovieList</servlet-name>
<url-pattern>/SelectMovieList.do</url-pattern>
</servlet-mapping>
</web-app>

Appreciate help in solving this issue.
Thanks
 
Sergio Tridente
Ranch Hand
Posts: 329
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Verify that you copied both jstl.jar and standard.jar in your /WEB-INF/lib folder.
[ March 26, 2007: Message edited by: Sergio Tridente ]
 
Vani Chinta
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I did copey both jstl and standard jars to lib directory. I tried both the versions of JSTL.jar . But the response is the same.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Copy/Paste the web-app tag from the following page. Yours seems to be lacking some spaces.
http://faq.javaranch.com/view?ServletsWebXml
 
Vani Chinta
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I did paste the web-app tag from the given URL. It still gives the same error. Interestingly when I used scripting to display movies I didnot have any probs with the same web.xml and it seems to be working fine.
I am using tomcat version 4.1.34. Is there any problem with this tomcat version by any chance?
 
Clifton Eaton
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat 4.x does not support jsp 2.0 or servlet 2.4. you should upgrade to 5.x if possible. See this page for a reference:

http://tomcat.apache.org/
 
Vani Chinta
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Got it working with Tomcat 5.5
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic