This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL Core Library Error

 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am a beginner in JSP and servlets. I am preparing for SCWCD1.4. I did some sample application using JSTL Core library, but i cant execute. It shows the following error

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

I have used the following directive
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

can anyone help me in this?..

Thanks in advance
bye for now
sat
[ January 18, 2005: Message edited by: Bear Bibeault ]
 
kumari Jain
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The error is because taglib tag in the deployment descriptor: web.xml is missing.
Add this to web.xml

<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/taglib/c.tld</taglib-location>
</taglib>


Also a tag lib descriptor file c.tld should be provided.This file is comes
along with jakarta-taglibs-standard-current.zip or a jstl standard package which you would have downloaded.
just make sure that c.tld is present in the path given in taglib-location tag .

regards,
kumari
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no, you don't need to have JSTL TLDs referenced in your web.xml. Just placing the TLD in the WEB-INF directory (and the jar in WEB-INF/lib) should be enough.
 
kumari Jain
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops!! Jeroen is right.you don't have to reference the tld in web.xml.
But now i have a doubt.
Then what is the purpose of uri attribute in taglib tag

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

what does it specify??
regards,
kumari
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi thanks for ur info. I did all the steps that u had mentioned in the previous posting. But I couldnt execute my program. Let me know the procedure ...
 
jyothi sanka
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using Tomcat 5 then you have to write taglib directive lkie this
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>

if you want clarification go through this url
http://www.javakb.com/Uwe/Forum.aspx/java-programmer/4149/JSP-Tomcat-5-and-EL

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64194
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 'rt' library is part of the JSTL 1.0 which should not be used with Tomcat 5. You should be using the JSTL 1.1 instead.
[ January 26, 2005: Message edited by: Bear Bibeault ]
 
jyothi sanka
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am learning jsps through HF Servlets&JSP book. I copied jstl.jar from Tomcat5.0 to web-inf/lib my curent application directory . When I use <%@ taglib uri= "http://java.sun.com/jsp/jstl/core" prefix ="c" > directive it didn't work. when I use <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
directive it's worked. I am not able to find my JSTL version also. How can I find the version of JSTL?
Thank you.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64194
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That URI is for JSTL 1.1. You obviously have 1.0 -- you can tell by the differing URIs. You can get an implementation of 1.1 from the jakarta site.
[ January 22, 2005: Message edited by: Bear Bibeault ]
 
jyothi sanka
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you provide me url of JSTL1.1 download? After downloading that copy where do I have to copy?
Thanks
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Thanks for ur information. Now it works fine. I have used the following <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

bye for now
sat
 
jyothi sanka
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am able to run and get output when I use <c:forEach> but I am not able to get an output If I use <c:if> or <c:when>. Please can anybody help me.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic