This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts and EL? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts and EL?" Watch "Struts and EL?" New topic
Author

Struts and EL?

Todd Farmer
Ranch Hand

Joined: May 28, 2004
Posts: 59
I posted this in the SCWCD forum first, but received no responses, so I thought this may be a more appropriate forum.

I'm finding as I try to implement the Struts example that is at the end of HF, my EL tags are not being evaluated in my JSPs. There is nothing in my web.xml or anywhere else that I can find that is directly responsible for this, and other (non-Struts) applications running on the same server (Tomcat 5) evaluate the EL expressions when I use the same JSP. I even tried going straight to the JSP (taking it out of WEB-INF) in the Struts app, and the EL still does not evaluate.

EL really gets promoted in HF, so I'm wondering why it would be disabled in Struts (if it is). Is there something I'm not doing right to enable EL? I know EL is enabled by default, but does that change when using Struts? I've searched through two Struts books and online, and I haven't found any answers. I see that there are subprojects of Struts that have "-el" attached to them (e.g., struts-el.jar), but I can't really find useful documentation on whether this would help me enable EL with Struts or not, or how to use it.

Any information or pointers would be greatly appreciated.

Todd Farmer
Suzanne Israel
Greenhorn

Joined: Aug 23, 2002
Posts: 11
Originally posted by Todd Farmer:
I see that there are subprojects of Struts that have "-el" attached to them (e.g., struts-el.jar), but I can't really find useful documentation on whether this would help me enable EL with Struts or not, or how to use it.


Todd - you're on the right track.

you will need to put the following in your WEB-INF/lib folder or server classpath in addition to struts.jar etc:

struts-el.jar
jstl.jar

Your JSP page should include EL-specific taglib directives, e.g:
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>

That should give you what you need.

Specific information regarding Struts EL implementation is at:
http://struts.apache.org/faqs/struts-el.html

There's also some helpful content regarding the non-EL vs EL Struts taglibs in Struts: The Complete Reference (James Holmes & Herb Schildt)

I hope this helps.

regards,
Suzanne Israel
[ October 31, 2004: Message edited by: Suzanne Israel ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts and EL?
 
Similar Threads
expression language
defining beans in struts-el
EL and Struts?
Doubt on EL and Custom Tags
Doubt related to EL