• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts and EL?

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic