This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Scope question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Scope question" Watch "Scope question" New topic
Author

Scope question

Niala Nirell
Ranch Hand

Joined: Mar 12, 2008
Posts: 46
Is there a difference between scope=request and scope=page in Standard Action?

one request can be used with several JSP with RequestDispatcher.include(), so scope=request is wider than scope=page for me
Rufus Addis
Ranch Hand

Joined: Aug 21, 2008
Posts: 83
..er I think you've answered your own question.

With a scope of page on a <jsp:usebean the bean is only available to the page so for example if you use the <jsp:include action to include the result from another jsp page, the included jsp won't have access to the bean.

On the other hand the scope of request is a wider scope. It allows not only the current page, BUT anything else that shares the same request i.e. a <jsp:include or <jsp:forward page to access the instantiated bean.

Rufus.
 
 
subject: Scope question
 
Similar Threads
Difference between request Scope and Page Scope?
jsp + thread safe
page scope
bean in or out scope?
Doubt Regarding implicit objects