aspose file tools*
The moose likes Other Application Frameworks and the fly likes spring? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "spring?" Watch "spring?" New topic
Author

spring?

Erwin Bredford
Ranch Hand

Joined: Feb 11, 2003
Posts: 167
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


--One learns a lot during a lesson but seeing is not enough,you must do;knowing is not enough ,you must apply--<br />SCJP 1.4,SCBCD,SCEA part 1,OCM JEE Enterprise Architect.
Craig Walls
author
Ranch Hand

Joined: Sep 19, 2003
Posts: 335
    
    5
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.


Spring in Action - Unleash POJO power in your applications!
Modular Java - Discover the secret weapon to modularity on the Java platform!
XDoclet in Action - Your complete guide to code generation with XDoclet.
Erwin Bredford
Ranch Hand

Joined: Feb 11, 2003
Posts: 167
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
 
 
subject: spring?