• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Page vs request

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

can any one tell me what is differnce between page and request. and where to use this PageScope and where to use ApplicationScope?

thanks,
Priya Agrawal
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you know what a request is?

If not, I recommend reading up on that first. Most books that explain JSPs/Servlets begin with a couple chapters on how requests/responses work and how to use them in J2EE.

If you already understand requests, well, you probably wouldn't need to ask this question.
[ July 28, 2006: Message edited by: Marc Peabody ]
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, as Marc said first you need to understand what request is.

If you know already what request is.. Request can go over multiple servlets and pages(by forwarding one to another). Request scope attribute has the lifetime as long as that request is available. Page scope attribute is available only in that particular page and not available through out the request.
You can think page attribute as still smaller scope than request.

There is no rule which says in which scope we need to have attribute value. It all depends on your application logic. You may probably store common attributes to entire applicaiton such as application name or admin email etc., in applicaiton scope. user name and user locale etc., in session scope. user entered values specific to screen in request scope.
HTH
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic