SRV.5.2 Attributes


Attributes are objects associated with a request. 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 RequestDispatcher ). Attributes are accessed with the following methods of the ServletRequest interface:

  • getAttribute

  • getAttributeNames

  • setAttribute

Only one attribute value may be associated with an attribute name . Attribute names beginning with the prefixes " java." and " javax. " are reserved for definition by this specification. Similarly, attribute names beginning with the prefixes " sun." and " com.sun. " are reserved for definition by Sun Microsystems. It is suggested that all attributes placed into the attribute set be named in accordance with the reverse package name convention suggested by the Java Programming Language Specification [1] for package naming.

[1] The Java Programming Language Specification is available at http://java.sun.com/docs/books/jls.



Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net