Actually getAttribute and setAttribute were meant to replace getValue and
putValue which were really deprecated in some classes from
javax.servlet/javax.servlet.http packages.
I believe there was an attempt to "deprecate" getParameter however in some
beta version of the spec (in favor of the universal GetParameterValues), but
due to programmers outcry the method was re-deprecated in final version.
Vadim Shun
NEW Corp
Dulles, VA
-----Original Message-----
From: Hans Bergsten [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 26, 2000 2:45 AM
Subject: Re: Is getParameter(String key) deprecated?
Yogesh More wrote:
>
> yep Farooq is right, it's 2.2.
> I got hold of both the 2.2 API and the docs ...
>
> The answer being -
> the method is deprecated and
> the method substituting it is
> Object getAttribute(java.lang.String key)
Actually, that's not quite true.
Yes, the latest version of the Servlet API is 2.2. This answer is easy to
find
by visiting Sun's Servlet API pages, at
<http://java.sun.com/products/servlets/>
Reading the information available there, plus your servlet container vendors
documentation, answers a lot of the questions posted on this list.
If you read the Servlet 2.2 API specification, you will also see that
the getParameter() method is *not* deprecated. This method, and the related
getParameterNames() and getParameterValues() methods, are used to read HTTP
request parameters. The getAttribute() method, and the other attribute
methods,
are used to read and set request *attributes*. A parameter is typically set
by
the client (e.g. the browser) and must be a string. An attribute is never
set
by the client, but it can be set by a servlet before forwarding to or
including
another servlet or JSP page. In fact, request attributes corresponds to the
request scope in JSP pages, so it's very commonly used to pass beans from
a servlet to a JSP page.
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html