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
Java SE 8 for the Really Impatient
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
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: Difference between getAttribute and getParameter
JavaBeans and Servlets
Assign String to a Session Attribute
Difference between getParameter and getAttribute
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