5.11. Die Attribut-API

Die drei Attribut-Gültigkeitsbereiche – Kontext, Anfrage und Sitzung – werden von den Interfaces ServletContext, ServletRequest und HttpSession verwaltet. Die API-Methoden für die Attribute sind in allen Interfaces völlig identisch.

Object getAttribute(String name)

void setAttribute(String name, Object wert)

void removeAttribute(String name)

Enumeration getAttributeNames()

kontext

<<interface>>ServletContext

getInitParameter(String)

getInitParameterNames()

getAttribute(String)

setAttribute(String, Object)

removeAttribute(String)

getAttributeNames()

getMajorVersion()

getServerInfo()

getRealPath(String)

getResourceAsStream(String)

getRequestDispatcher(String)

log(String)

// ... und VIELE weitere Methoden ...

Anfrage

Get Servlets und JSPs™ von Kopf bis Fuß now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.