This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

when to use

 
deepak singh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
when to use get or setAttribute
and when to use get or setParameter
pls help me out
deepak
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parameters can only be read. (ie request.getParammeter("string")) and will only return Strings. A parameter is the data sent to you from the web page.
Attributes can be read or written (request.getAttribute() and request.setAttribute()) and can hold objects. Attributes are a place holder for any extra data you would like to have associated with this request (eg figured data) but it is not allowed to interfere with the parameters passed from the client.
Does this cover it?
Dave.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic