• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting confused between getAttributes() and setAttributes() of request objects

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting confused between getAttributes() and setAttributes() of request objects

 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4252
227
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please TellTheDetails - What is your confusion?
Have you ever checked the documentation of HttpServletRequest ?
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getattributes() and getparameters()

whats the difference between them?


getparameters are used to get parameter values

but whats with getAttributes() ,isnt it the same?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are no such methods as getattributes() and getparameters() -- they are getAttribute() and getParameter().

And they aren't even close to the same thing.

Request parameters are those submitted to a servlet as part of the request -- form values, for example.

Objects can be placed into request scope, also called scoped variables, with setAttribute() and retrieved with getAttribute() (or with the EL in JSPs).
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal Hegde wrote:getattributes() and getparameters()

Well then, do you need to correct your topic's subject?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic