• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Difference between getParameter and getAttribute

 
Jahnavi Kondapaneni
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can anybody explain me the difference between getParameter and getAttribute functions.
Thanks in advance.

Regards,
Janu
 
akhilesh pandey
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
getParmeter() returns a String, whereas getAttribute() returns an Object. Remember always to cast the object to the required type, when using getAttribute().
 
Kunal Jag
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Jahnavi Kondapaneni
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys!!!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic