File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
EJB 3 in Action
this week in the
EJB and other Java EE Technologies
Difference between getAttribute and getParameter
Joined: Nov 30, 2004
May 04, 2005 04:29:00
I am at present working on
, I am encountered an difficulty in differentiating b/w getAttribute and getParameter in servlets
I basicallly know
request.getAttribute("String") returns value in
request.getParameter("String") returns an Object :roll:
I did not understand what type of object it returns
Thanks in advance
Joined: Dec 11, 2004
May 04, 2005 04:35:00
You've got it backwards.
GetParameter returns a String. It's what you use to retrieve form parameters from an HTTP post.
getAttribute(String) and setAttribute(String, Object) are what you use to bind object variables to a scope (request, session, or context) and retrieve them from another
How to ask a question...
Simple Servlet Examples
I agree. Here's the link:
subject: Difference between getAttribute and getParameter
JavaBeans and Servlets
Difference between getParameter and getAttribute
what is the attribute in servlet ?
difference between getParameter() and getAttribute()
Assign String to a Session Attribute
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014