<title>ServletContext</title>

<p/>The ServletContext object is a straight reflection from the
Servlet interface.

<p/>The JSP <a href='jsp.xtp#application'>application</a> object is a
ServletContext object.

<objsummary/>

<section title='ServletContext' version=resin1.0>

<defun title='getAttribute(name)'>
<sum>Returns the value corresponding to <var/name/>.</sum>
Applications can use the attributes to store arbitrary data.
</defun>

<defun title='getAttributeNames()'>
<sum>Returns an enumeration of all attribute names.</sum>

<example title='List Attributes'>
<example>
context.attribute["foo"] = 1
context.attribute["bar"] = 2

for (var name in context.attribute) {
  writeln(name + " : " + context.attribute[name]);
}
</example>
<results>
foo : 1
bar : 2
</results>
</example>
</defun>

<defun title='setAttribute(name, value)'>
<sum>Sets an attribute to an arbitrary value.</sum>
</defun>

<defun title='removeAttribute(name)'>
<sum>Removes an attribute from the context.</sum>
</defun>

<defun title='majorVersion'>
<sum>Returns the major version of the Servlet API.</sum>
</defun>

<defun title='minorVersion'>
<sum>Returns the minor version of the Servlet API.</sum>
</defun>

<defun title='serverInfo'>
<sum>Returns a string describing the servlet engine.</sum>
</defun>

<defun title='log(msg [, exception])'>
<sum>Adds <var/msg/> to the servlet engine's log file.</sum>  This is
the preferred way to log errors.
</defun>

</section>