This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
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
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply 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: 984

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



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

Joined: Jul 29, 2008
Posts: 2729
    
    3

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


Author of ExamLab (Download) - the free mock exam kit for SCJP / OCPJP
HELP me! -- Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 984

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: 56554
    
  14

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Mark E Hansen
Ranch Hand

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

Well then, do you need to correct your topic's subject?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Getting confused between getAttributes() and setAttributes() of request objects
 
Similar Threads
parameters, headers, and attributes
what is meant by Context Attributes? is it that the attribute is visible to entire web app
another question
request object in multiple jsp pages
Problem populating a newly created HashMap in a Struts2 Action