• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to Resolve JSTL taglib Declaration

 
Somnath Mallick
Ranch Hand
Posts: 482
  • 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:

 
Bosun Bello
Ranch Hand
Posts: 1510
  • 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: 482
  • 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?
 
David Newton
Author
Rancher
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: 482
  • 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: 482
  • 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
Rancher
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: 482
  • 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
Rancher
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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: 482
  • 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.
 
Sri Karr
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>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic