scope resolution in JSP
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Can someone explain the difference between 'page scope' and 'request scope'? In this book I am reading it says, " The request scope is for objects that need to be available to all pages processing the same request".
I am confused by this statement. Lets say I have page A that has a 'Next' button that takes me to page B. Similarly the 'Next' on page B takes me to page C and so on.. Now, isn't the request made to the web server different from Next on page A to that of the Next on page B?! If that is true, how can we have the "same request" for multiple pages?
I am confused by this statement. Lets say I have page A that has a 'Next' button that takes me to page B. Similarly the 'Next' on page B takes me to page C and so on.. Now, isn't the request made to the web server different from Next on page A to that of the Next on page B?! If that is true, how can we have the "same request" for multiple pages?
IBM Certified in Object-Oriented Analysis and Design with UML
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Page scope is the smallest, an object in page scope can't be seen if you forward the request. It has nothing to do with your example of HTML pages, it refers to a JSP page.
An object in request scope only lives during a single request - response cycle.
Bill
------------------
author of:
An object in request scope only lives during a single request - response cycle.
Bill
------------------
author of:
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
If you set a page-scope attribute and then forward the request, the attribute will not be visible to the forwarded page. If you set a request-scope attribute, it will be visible to the forwarded page. I believe pages included via jsp:include work the same way, but I'm not 100% sure.
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
That helps!! Thanks a lot :-)
| Lookout! Runaway whale! Hide behind this tiny ad: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |









