Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JasperException with JSTL

 
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Cheers,
Ram.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Mani vannan
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
Bartender
Posts: 1780
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As stated in the FAQ: http://faq.javaranch.com/view?JstlTagLibDefinitions

The uri for JSTL1.1 is <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

You have on your page the JSTL1.0 uri: <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

Use the correct taglib import statement, and your problems should disappear.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic