• Post Reply Bookmark Topic Watch Topic
  • New Topic

Scope question

 
Niala Nirell
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
..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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!