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 Web Component Certification (SCWCD/OCPJWCD) and the fly likes Page Scope useBean 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 » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Page Scope useBean" Watch "Page Scope useBean" New topic

Page Scope useBean

Aruneesh Salhotra
Ranch Hand

Joined: May 12, 2004
Posts: 167
Can someone describe what the pageScope in useBean essentially mean.
I know that if gives the method findinscope(attribute) method which might come in handy.

Apart from that is there any useful purpose for the pageScope.
Sergey Tyulkin
Ranch Hand

Joined: May 10, 2005
Posts: 87
Imagine you have 2 JSPs. And first includes the second. Then, if they both define a variable with the same name, and put it in request scope, then the first page will receive value from the second page (and this behaviour may be wrong). But if the use page scope, then they will have different variables.
You can think about page scope variable as private variables in ordinal class. Only this page will have an access to them
Aruneesh Salhotra
Ranch Hand

Joined: May 12, 2004
Posts: 167
Thanx for the explaination on this. This absolutely is required.
A rare situation to happen, but practically it should be handled through pageScope.
Don't get me started about those stupid light bulbs.
subject: Page Scope useBean
Similar Threads
Is there any method as in context like setAttribute() in config ?
Asking mock Q
Why do we need pageScope implicit object in EL?
Not retrieving from the Java Bean
Difference between request Scope and Page Scope?