Two Laptop Bag*
The moose likes Servlets and the fly likes Getting confused between getAttributes() and setAttributes()  of request objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Getting confused between getAttributes() and setAttributes()  of request objects" Watch "Getting confused between getAttributes() and setAttributes()  of request objects" New topic
Author

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

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

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



http://www.lifesbizzare.blogspot.com || OCJP:81%
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3019
    
  35

Please TellTheDetails - What is your confusion?
Have you ever checked the documentation of HttpServletRequest ?


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

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

Joined: Jan 10, 2002
Posts: 60785
    
  65

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).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
Vishal Hegde wrote:getattributes() and getparameters()

Well then, do you need to correct your topic's subject?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Getting confused between getAttributes() and setAttributes() of request objects
 
Similar Threads
request object in multiple jsp pages
what is meant by Context Attributes? is it that the attribute is visible to entire web app
another question
Problem populating a newly created HashMap in a Struts2 Action
parameters, headers, and attributes