This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Unable to Resolve JSTL taglib Declaration

 
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

I am trying to use JSTL taglibs in my JSP page. I have added the line:

at the start of the JSP. I also have standard-1.0.6.jar and jstl-1.0.4.jar downloaded from maven in my classpath. But in Eclipse I get an error saying that:

 
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Verify that those jars are in ' WEB-INF/lib' of your application.
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup they are in WEB-INF/lib folder of my eclipse project. Also would like to know that should we make changes in the web.xml file for adding taglibs?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't that a really old version? (Can't keep the versions straight in my head.)

If it is, try:as the URI--it changed.
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/jstl/core worked! Man... these versions!
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well now i run the jsp page and i get an error:


 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where do you configure soemthing to use /WEB-INF/c.tld?
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well i didn't get your question! Well eclipse does that automatically edits the web.xml file, doesn't it?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something in your project refers to /WEB-INF/c.tld. If there's no TLD file there that won't work.
 
Marshal
Posts: 67275
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using an antiquated version of the JSTL to being with?
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well my web application is in version 2.4. I am using Tomcat 6.0.20. Actually I have to use the code for Java 1.4. So i have to use JSTL 1.1 specification. I read that JSTL 1.2 can be used for web application version 2.5 and and Java 1.5.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at your web.xml file in your application.
I hope the below information will resolve your problem.

http://faq.javaranch.com/java/SetupJstlForJsp2

How do I declare the web.xml file for Servlets 2.5 and JSP 2.1? (Tomcat 6.0.14 and so on)

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>web app name here</display-name>

<!-- rest of declarations go here -->

</web-app>
How do I declare the web.xml file for Servlets 2.4 and JSP 2.0? (Tomcat 5, Resin 3, and so on)


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

<display-name>web app name here</display-name>

<!-- rest of declarations go here -->

</web-app>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!