File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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: 63867

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