File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JasperException with JSTL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JasperException with JSTL" Watch "JasperException with JSTL" New topic

JasperException with JSTL

Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
My dear fellow ranchers,

Requesting you to kindly help me with the following scenario.

I am using Tomcat 5.0.30 and I thought i would learn a bit of JSTL. So, I got the jar files jstl-1.1.1.jar and standard-1.1.1.jar along with the other jar files.

My JSP looks like

My web.xml file looks like

The jars are in the /WEB-INF/lib folder and the ".tld" files are in the WEB-INF folder.

After doing all these things, the error I get looks like

org.apache.jasper.JasperException: /Demo.jsp(10,6) According to TLD or attribute directive in tag file, attribute value does not accept any expressions

Any help in this regard? Please let me know where am I going wrong.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63857

You don't need to include the tag elements in the web.xml, and you are using the wrong URI for the JSTL. The tld files should be left inside the jars where the container can find them via the URI.

Remove the web.xml elements, delete the tld files, and see the JSP FAQ for more details on using the right URI for JSTL 1.1 and JSP 2.0.
[ April 01, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
Mani vannan
Ranch Hand

Joined: Aug 21, 2004
Posts: 185
"according to the tld spec, the expression is not allowed" -- means you cannot use 'expression' as an argument to the attribute of <c ut>

Stefan Evans

Joined: Jul 06, 2005
Posts: 1580
As stated in the FAQ:

The uri for JSTL1.1 is <%@ taglib prefix="c" uri="" %>

You have on your page the JSTL1.0 uri: <%@ taglib prefix="c" uri="" %>

Use the correct taglib import statement, and your problems should disappear.
I agree. Here's the link:
subject: JasperException with JSTL
It's not a secret anymore!