aspose file tools*
The moose likes JSP and the fly likes JSTL Core Library Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL Core Library Error" Watch "JSTL Core Library Error" New topic
Author

JSTL Core Library Error

satishkumar janakiraman
Ranch Hand

Joined: May 03, 2004
Posts: 334
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

Joined: Jul 28, 2004
Posts: 44
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

Joined: Oct 12, 2000
Posts: 5093
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.


42
kumari Jain
Ranch Hand

Joined: Jul 28, 2004
Posts: 44
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

Joined: May 03, 2004
Posts: 334
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

Joined: Aug 27, 2001
Posts: 39
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

Joined: Jan 10, 2002
Posts: 61437
    
  67

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
jyothi sanka
Ranch Hand

Joined: Aug 27, 2001
Posts: 39
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

Joined: Jan 10, 2002
Posts: 61437
    
  67

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

Joined: Aug 27, 2001
Posts: 39
Can you provide me url of JSTL1.1 download? After downloading that copy where do I have to copy?
Thanks
satishkumar janakiraman
Ranch Hand

Joined: May 03, 2004
Posts: 334
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

Joined: Aug 27, 2001
Posts: 39
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
 
subject: JSTL Core Library Error