Tuesday 29 July 2014

Attributes

Attributes may be set by the container to express information that otherwise could not be expressed via the API, or may be set by a servlet to communicate information to another servlet (via the RequestDispatcher).

ServletRequest interface provides below methods to set, get and remove Attributes.

    getAttribute(String name)
    getAttributeNames()
    setAttribute(String name, Object o)
    removeAttribute(String name)

Attribute names should follow the same conventions as package names. Attribute names beginning with the prefixes of java. and javax. are reserved for definition by this specification. Similarly, attribute names beginning with the prefixes of sun., and com.sun.




Prevoius                                                 Next                                                 Home

No comments:

Post a Comment