This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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

JavaRanch » Java Forums » Java » JSP
Bookmark "scope of EL function return values" Watch "scope of EL function return values" New topic

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?


Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63198

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]
I agree. Here's the link:
subject: scope of EL function return values
It's not a secret anymore!