Meaningless Drivel is fun!
The moose likes JSP and the fly likes Not able to access JSTL tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Not able to access JSTL tags" Watch "Not able to access JSTL tags" New topic

Not able to access JSTL tags

selvi family
Ranch Hand

Joined: Nov 26, 2004
Posts: 39
Hi ..

I am new to JSTL.I am using Tomcat 4.1.24 and Java 1.4

I have copied jstl.jar and standard.jar(includig dependancy jar files) into WEB-INF\lib folder.

I've placed all the *.tld file under WEB-INF\taglib folder

this is the web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns=""





<display-name>Hello World!</display-name>


JSP is my JSP : jstlcore.jsp

<%@ taglib prefix="c" uri="\WEB-INF\taglib\c.tld" %>

<title>Simple Example</title>

<c:set var="browser" value="${header['User-Agent']}"/>
<c ut value="${browser}"/>


When I run this jstlcore.jsp in browser I got the following error.

org.apache.jasper.JasperException: XML parsing error on file \WEB-INF\taglib\c.tld: (line 3, col 8): Document is invalid: no grammar found.
at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(
at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(
at org.apache.jasper.compiler.TagLibraryInfoImpl.(

I tried changing the URI in jsp to
<%@ taglib prefix="c" uri="" %>

I got the different error
org.apache.jasper.JasperException: This absolute uri ( cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(

please some one help me to solve this..
Stefan Evans

Joined: Jul 06, 2005
Posts: 1580
Where to start?
1 - All you need to use JSTL is the two jar files in the web-inf/lib directory.
- NO tld files
- NO entries in web.xml

2 - You have Tomcat4. Tomcat4 is a Servlet2.3/JSP1.2 container.
You have declared your web.xml file as supporting Servlet2.4.
Obviously that won't work. Change it to the standard 2.3 DTD.
Look in [TOMCAT]/webapps/ROOT/web-inf/web.xml for an example

So as a result of the changes, your web.xml should look something like this.

With Tomcat4, you need to use JSTL1.0. Make sure you have downloaded the correct version.
Import it into your webpage with the following tag:
<%@ taglib prefix="c" uri="" %>

If you have fixed up your web.xml and removed the extra tld files, it should work at this point.

selvi family
Ranch Hand

Joined: Nov 26, 2004
Posts: 39
Thank you so much..I got it..
I agree. Here's the link:
subject: Not able to access JSTL tags
jQuery in Action, 3rd edition