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