This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

spring?

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am a spring newbie .
i am testing out some spring code from the mvc step-by-step toturial and i dicovered that the jstl tags
<c ut value="${product.name}">
throws an error saying that that tag does not support expression language .
so i want to use scriptlets instead of tags that come with the tutorial.does anyone how to use jsp scriptlets with spring .thanks


please could u help me out
 
author
Posts: 396
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by chinedu efoagui:
i am a spring newbie .
i am testing out some spring code from the mvc step-by-step toturial and i dicovered that the jstl tags
<c ut value="${product.name}">
throws an error saying that that tag does not support expression language .
so i want to use scriptlets instead of tags that come with the tutorial.does anyone how to use jsp scriptlets with spring .



I could help you use Spring with scriptlets, but I'd rather help you fix your JSTL problem. Which JSTL JARs are you using? How are you declaring the tags (in web.xml or in the JSP pages themselves)?

This is important because JSTL tags come in two flavors: those that use JSTL EL and those that use JSP runtime EL.

In JSTL 1.0, you had to be specific about which TLD to use: either c.tld or c-rt.tld. If you use c.tld, you'll get the errors like you described. If you use c-rt.tld, then you should be fine. (The same applies to fmt.tld and the others, but I'm just picking on c.tld because it's the most commonly used set of tags.)

In JSTL 1.1, there's only one TLD file and things are much simpler. The c.tld handles runtime EL fine and you don't have to declare the tags in web.xml. Just have the JAR files in the classpath and specify the tag in the JSP file as:



There really needs to be a definitive and well-publicized FAQ on this. I personally struggle with the same issue almost every time I start a new project. Once you get it setup right, developing with JSTL is a breeze. But if you're like me, you forget how you did it last time and have to look it up again (or cut-n-paste from another project).

If you're still struggling with this, let me know and I'll show you how to use scriptlets...but you really should try to get JSTL working before you resort to scriptlets.
 
Erwin Bredford
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks i got it working with jstl i used
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
and copied the jstl.jar from netbeans 4.0 to my lib instead from the jstl.jar from the spring framework 1.5
thanks again
 
Get off me! Here, read this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!