This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes diff between parameter and attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "diff between parameter and attribute" Watch "diff between parameter and attribute" New topic

diff between parameter and attribute

samdeep aarzoo
Ranch Hand

Joined: Jun 09, 2005
Posts: 160
what is the difference between parameter and attribute
can anybody explain in detail
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
As I feel it parameter is always String and attribute is always Object.

SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Aruneesh Salhotra
Ranch Hand

Joined: May 12, 2004
Posts: 167
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

Joined: Aug 16, 2005
Posts: 3
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
I agree. Here's the link:
subject: diff between parameter and attribute
It's not a secret anymore!