A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
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
difference between getParameter() and getAttribute()
Assign String to a Session Attribute
Difference between getParameter and getAttribute
what is the attribute in servlet ?
JavaBeans and Servlets
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015