wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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
subject: diff between parameter and attribute
Similar Threads
Difference between request parameter and request attribute
argument or parameter? attribute or property?
request.getAttribute vs request.getParameter
different between parameters and attributes
Class Cast Exception while reading the int value from a session object