• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

diff between parameter and attribute

 
samdeep aarzoo
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the difference between parameter and attribute
can anybody explain in detail
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I feel it parameter is always String and attribute is always Object.
 
Aruneesh Salhotra
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Attribute defines a property of an Object, like you have init-param for servlets. These are like properties of the servlets, or Servlet Context.

Parameter are like passed parameters to functions, pages (JSP's).
 
Sidharth Rajan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting and Setting is also an important difference when talking about parameters and attributes.

Request ->
parameters: we can only get parameters .. as I understand it .. we cannot set them.
attributes: we can get/set/remove the attributes.

Session ->
no parameters
attributes: get/set/remove allowed

Context -> ( Servlet Context )
parameters: are configured in DD. therefore can get but cannot set.
attributes: can get/set/remove.

Hope that helps

- Siddhartha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic