SE452: Request Attributes [8/20] Previous pageContentsNext page

A ServletRequest can also have attributes. Attributes are not the same as parameters. A parameter is something passed in from the user or the Request. An attribute is an Object associated with this request. If you look at the Servlet APIs, you will see that the following objects all have Attributes - ServletRequest, HttpSession, and ServletContext. These classes correspond with the different scopes that are available to the web application.

java.lang.Object getAttribute(java.lang.String name) 
java.util.Enumeration getAttributeNames() 
void setAttribute(java.lang.String name, java.lang.Object object)  

Previous pageContentsNext page