File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP Expression Tag Vs JSTL Expression Language Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Expression Tag Vs JSTL Expression Language" Watch "JSP Expression Tag Vs JSTL Expression Language" New topic
Author

JSP Expression Tag Vs JSTL Expression Language

Chetan Pandey
Ranch Hand

Joined: Aug 01, 2005
Posts: 31
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

Joined: Jan 10, 2002
Posts: 60752
    
  65

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Expression Tag Vs JSTL Expression Language
 
Similar Threads
EL and Scriptlet
JSTL + custom tags
EL [] operator question
simple use bean questions
Check content before adding to JSP