aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Difference between getParameter and getAttribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Difference between getParameter and getAttribute" Watch "Difference between getParameter and getAttribute" New topic
Author

Difference between getParameter and getAttribute

Jahnavi Kondapaneni
Ranch Hand

Joined: Jan 25, 2008
Posts: 56
Hi,
Can anybody explain me the difference between getParameter and getAttribute functions.
Thanks in advance.

Regards,
Janu
akhilesh pandey
Greenhorn

Joined: Jun 03, 2008
Posts: 17
I think getParameter is a method where in the you get the things from Url. No where you set the paramter values to get it,but in getAttribute you need to first set the attribute values using setAttribute method.
Gopikrishna Kunisetty
Ranch Hand

Joined: Jun 12, 2008
Posts: 35
getParmeter() returns a String, whereas getAttribute() returns an Object. Remember always to cast the object to the required type, when using getAttribute().


- Krishna<br /> SCJP 1.4 SCWCD 5
Kunal Jag
Ranch Hand

Joined: Jun 08, 2008
Posts: 31
Newcomers to Web app development often get confused between attributes and parameters. Following are the two key differences between parameters and attributes:
1. Attributes are always set programmatically, while initialization parameters ( for example, servlet initialization and context initialization) are set declaratively in the DD file.
2. Also, there�s different in their APIs, for instance, the return type of parameters is String while that of Attributes is an Object.

Regards,


Kunal Jaggi<br />Author of <a href="http://www.tatamcgrawhill.com/html/titleDetail.jsp?isbn=9780070249103.html" target="_blank" rel="nofollow">"SCWCD Exam Guide"</a>, SCWCD 5 (exam 310-083 and 310-084), <a href="http://www.tatamcgrawhill.com/html/titleDetail.jsp?isbn=9780070249103.html" target="_blank" rel="nofollow">McGraw-Hill</a><br /><a href="http://javaevangelist.com/" target="_blank" rel="nofollow">http://javaevangelist.com/</a><br /><a href="http://www.oreillynet.com/pub/au/2669" target="_blank" rel="nofollow">http://www.oreillynet.com/pub/au/2669</a>
Jahnavi Kondapaneni
Ranch Hand

Joined: Jan 25, 2008
Posts: 56
Thanks guys!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between getParameter and getAttribute
 
Similar Threads
difference between getParameter() and getAttribute()
What is the diff b/w getAttribute and getParameter
getParameter()
getParameter,getAttribute
Difference between getParameter() and getAttribute()