• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Confusion between page scoped objects and Request scoped objects

 
Ranch Hand
Posts: 34
Eclipse IDE MySQL Database Java
  • 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.
 
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 MySQL Database Java
  • 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
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Shwetha Sharma wrote:According to Jsp speculations


These are called specifications
 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic