• 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

dout in request scoped attribute and parameter

 
Ranch Hand
Posts: 188
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

I want to know the difference between the scope (visiblity) of a request scoped attribute (request.setAttribute() ) and request parameter (name/value pairs that come from a form)

thanks
 
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sid,

request Paramerters -

These will bundled by container into ServletRequest implementation Object.
Scope is available to all filters/sevlets/jsps wihch are participating in that request,response chain.
(be careful here request parameters can also be over-ridden while forwarding to another component, but still we can get the original queryString)

Once the response it committed. Thats it container will throw them away.
we are not expected to hold the references to them

request Attributes -

Are added at server side After the ServletRequest is available to
filter/servlet/jsp's.

SCOPE is same as request parameters. These can be dynamically changed by any component participating in the request -- response chain.
[ August 19, 2007: Message edited by: Srinivasan thoyyeti ]
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a parameter will aways be a String while attributes can be any object but will be retrieved (getAttribute) as an object and you will have to cast to the object type
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic