File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JavaBean Scope in JSP pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JavaBean Scope in JSP pages" Watch "JavaBean Scope in JSP pages" New topic

JavaBean Scope in JSP pages

Reema Patel
Ranch Hand

Joined: Jan 26, 2006
Posts: 169
Hello All,
I'm struck at understanding the scope of a JavaBean used inside a standard action element.

For example, considet the following code snippet:

To my surprise, the page works fine. I think the JSP engine should not have even compiled the page, cause the scope of the two elements is different. It should have flaged a compilation error.....

After digging into the work directory this is what I found from the generated servlet:

Pls. help...
[ October 21, 2006: Message edited by: Reema Patel ]
Reema Patel
Ranch Hand

Joined: Jan 26, 2006
Posts: 169
Since nobody has posted a reply...let me try to do some study here.
The same code with some modification now causes compilation error:

I'm still lost as to why does it happen so........
I agree. Here's the link:
subject: JavaBean Scope in JSP pages
It's not a secret anymore!