• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

question about page scope

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which statements are true about scope in jsp pages?
1) Objects with page scope are stored in the implicit object PageConttext
2) If a page forwards to another page, objects created with request scope in the source page will be visible in request of the forwarded page
3) Objects with application scope can be created in pages that are not session-aware(with page attribute session=”false”
4) The implicit page object has pageContext scope
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1,3 & 4 are correct
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think that 2 also is correct..
the attributes added in request have to be accesible in forwarded page,
dispatcher.forward(REQUEST,response)
please, clear up this..
thanks
 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
2 should be correct. remember, you can use RequestDispatcher to forward to an error-page? to do this, you set the exception related attributes in the request.
It is the parameters in the request, that may got lost. I might be wrong with this, it has been a while I kind of forget this point.
 
Raj Paul
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
2) If a page forwards to another page, objects created with request scope in the source page will be visible in request of the forwarded page

Here it has been said... that objects created with request scope, does it mean objects that are set in request scope ?
if i create String s="" inside jspService(), it is request scope right ?
This variable u may not get in forwared page.

Raj Paul
 
no more user
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Raj Paul:
if i create String s="" inside jspService(), it is request scope right ?


default scope is page.
 
no more user
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

4 is really correct !?

i believe pageContext is not a valid scope
[ December 10, 2006: Message edited by: Alexandre Lima ]
 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Raj Paul:
2) Here it has been said... that objects created with request scope, does it mean objects that are set in request scope ?
Raj Paul


Isn't it ??? If some one says that a object created with some scope, then what should we understand ??? ...ofcourse the object has to be set in that scope. If the object is not set in that scope then what the meaning of saying that it is created with that scope...
[ September 29, 2002: Message edited by: Nazmul Huda Sarkar ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic