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?
IBM Certified in Object-Oriented Analysis and Design with UML
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:
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.