Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confusion between page scoped objects and Request scoped objects

 
Shwetha Sharma
Ranch Hand
Posts: 34
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to Jsp speculations,
All references to page scoped objects shall be released after the response is sent back to the client from the JSP page.
References to the request scoped objects shall be released after the request is processed.
Aren't all page scoped objects withing the request scope.
I am not able to make out the exact difference between them.
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shwetha Sharma wrote:
All references to page scoped objects shall be released after the response is sent back to the client from the JSP page.

Give me the fragment from the specs about that.

Page Scope and Request Scope are not the same. One request can be handled by many servlets and JSP using forward(...) method. All of the servlets and JSP will be able to use that request variables but Page Variables can be reached from within the page which declared them.
Page Scope is the narrowest one.
 
Shwetha Sharma
Ranch Hand
Posts: 34
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Give me the fragment from the specs about that.


This is the fragment from the speculations

Objects are created within a JSP page instance that is responding to a request
object. There are several scopes:
page - Objects with page scope are accessible only within the page where they
are created. All references to such an object shall be released after the response
is sent back to the client from the JSP page or the request is forwarded somewhere
else. References to objects with page scope are stored in the pageContext
object.
request - Objects with request scope are accessible from pages processing the
same request where they were created. References to the object shall be released
after the request is processed. In particular, if the request is forwarded
to a resource in the same runtime, the object is still reachable. References to
objects with request scope are stored in the request object.
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All references to such an object shall be released after the response
is sent back to the client from the JSP page or the request is forwarded somewhere else

Please read my first post in this thread once again carefully
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shwetha Sharma wrote:According to Jsp speculations

These are called specifications
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic