Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Expression Tag Vs JSTL Expression Language

 
Chetan Pandey
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All:

We all know that Java Scriptlets, Declarations etc should not included in JSP Pages as they make Code appear like Clutter , becomes debugging nightmare etc.

But I want to know how I can do something like the following in JSTL EL.



Line 1: can be managed as
<c:set var="oUser" value=${sessionScope.userObject} />

But then how do I call generateMenu() etc.

The Question boils down to how does one call functions which may or may not be in any scope example static methods.

For example:

how do I do the following in EL:

<%= com.MyObj.staticFinalString %>

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't. The EL purposefully has no ability to call general methods. If you find yourself needing to, it's a good sign that your JSP is trying to do a job that should have been handled by the page controller.
[ December 03, 2007: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic