Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Attributes Vs Parameters

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I'm having hard time in getting to know what exactly is the difference between Attributes and Parameters?? Can anyone provide a brief and crisp explanation for the differences between the two??

Thanks in advance.
 
prashanth kumar
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
short explanation is that you can store objects when you call setAttribute() but you cant do that in setParameter()
Other than that there is not much difference in the Attribute and Parameter names.

Cheers
[ January 01, 2007: Message edited by: prashanth kumar ]
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prashant, don't go away...please confirm this. So with attributes, we can store Objects and Strings and with parameters it is just Strings and also the scope of a parameter is only for the request and not like session, application and so on like we have for Attributes. Please correct me if I'm wrong.

Thanks for the help.
 
Stary Kapec
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

There can be request parameters that comes with http requests and init parameters from web.xml.
Request params comes from the outside world of the application. Usually from html forms. They can be the data the user enters.
Init params are the deploy-time constants so you can configure your application in the time of deployment.

The concept of attributes is different. They are used so the app components could communicate with each other. For example servlet can send a message (through an attribute) to a jsp page. Or a ContextListener (another app component) can send a message to all other app components (in context scope attribute)
[ January 01, 2007: Message edited by: Jasiek Motyka ]
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Allright, thanks for the explanation. I think I got it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic