This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes scope of EL function return values 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 "scope of EL function return values" Watch "scope of EL function return values" New topic
Author

scope of EL function return values

Yan Zhou
Ranch Hand

Joined: Sep 02, 2003
Posts: 137
Hi there,

With the following JSP code, once I make the selection and submit the form, I suppose there is only one object in the request scope, "selection".

I wonder under which scope does the return value of EL function, my:getItems() reside, is that page scope? In other words, the page scope will contain a list of item objects?

Thanks.
Yan

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60773
    
  65

The return value of your EL function is intrinsically stored nowhere. In this example, since you are using it as the items value of a forEach tag, its consecutive elements will be stored in page scope using the name item only within the body of the forEach tag.

The elements will not be available outside the forEach body, and the return value of the function itself is never stored in any scope.
[ October 27, 2005: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: scope of EL function return values
 
Similar Threads
Dropdown populates other fields
Element Shift Problem in Dynamic Form
Instantiate object without scriptlet
How to Validate more then one selection list?
Problem With Using c: Tag to Display Drop-Down Menu