Forums Register Login

Difference between getParameter and getAttribute

+Pie Number of slices to send: Send
Hi,
Can anybody explain me the difference between getParameter and getAttribute functions.
Thanks in advance.

Regards,
Janu
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
getParmeter() returns a String, whereas getAttribute() returns an Object. Remember always to cast the object to the required type, when using getAttribute().
+Pie Number of slices to send: Send
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,
+Pie Number of slices to send: Send
Thanks guys!!!
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1847 times.
Similar Threads
getParameter,getAttribute
difference between getParameter() and getAttribute()
Difference between getParameter() and getAttribute()
getParameter()
What is the diff b/w getAttribute and getParameter
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:00:14.