Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaBean Scope in JSP pages

 
Reema Patel
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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........
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic