• 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

Attribute versus Parameter

 
Ranch Hand
Posts: 52
Oracle Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,
I read the posts on the difference between the attribute and the parameter here.I got this by reading the posts.
Attributes are Objects and set by developer while parameters come from the user request.
Again the attributes are scoped variables.

But still I am having some doubts in my mind about the attribute and parameter

1. What is mean by there attributes "SCOPED VARIABLES" are parameters not scoped one?

2. Again what is need to set attributes externally? Why cant this facility provided for the parameter?

3. Why we do not have parameters as the objects?



I got this question in mind while I was writing above question that

Is attribute introduced later in Servlet and parameters are early one?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remember that the request is an HTTP request. So it has parameters because HTTP says it has parameters. And those parameters are strings because HTTP says they are strings. This idea didn't just get invented by the people who designed the Java EE specifications, they implemented somebody else's requirements.

As for request attributes: sometimes it is useful to keep track of certain information while the request is being processed, and then discard it when that processing is finished. Hence a design which allows the programmer to do that. This information is called "request attributes". It's also convenient for them to be any Java objects, rather than making an artificial requirement that they have to be strings.
 
Swapnil Sanghai
Ranch Hand
Posts: 52
Oracle Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul.
 
reply
    Bookmark Topic Watch Topic
  • New Topic