• 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

Using EL within a servlet

 
Ranch Hand
Posts: 147
Eclipse IDE Tomcat Server Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a servlet that needs to send an e-mail message. The application was originally running on Tomcat 5.5, using Servlet 2.4/JSP 2.0/EL 1.0, all provided by the Tomcat container. I wrote the e-mail message to leverage EL, and then had my databean simply implement VariableResolver (resolved member variables) and FunctionMapper (always returns null - not used), and then resolved my e-mail message with this line:



That worked very well until we moved to Tomcat 6.0 (Servlet 2.5/JSP 2.1/EL 1.2). EL was completely changed, and the above no longer works. I found a very simple solution, adding Apache Commons EL 1.0 library to the web app, everything is fine.

However, I really want to know how the new EL is supposed to work, and have yet to find any decent examples from the java code side (lots of stuff from the JSP / JSTL side!). Does anyone know of any good examples of implementing the new ELResolver class in EL 1.2? It seems like a lot more complexity than in 1.0, and I could really use some examples ;)

Thanks to anyone with suggestions!
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(Not directly related, but ugh, I'd just use FreeMarker or similar templating language.)
 
Pete Nelson
Ranch Hand
Posts: 147
Eclipse IDE Tomcat Server Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@David -

Not a bad suggestion! I will take a look at FreeMarker. I am still curious about EL, but if FreeMarker provides a simple solution, I'd probably run with it.
reply
    Bookmark Topic Watch Topic
  • New Topic