Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » core » [javadoc | source]
org.apache.catalina.core
public class: ApplicationContext [javadoc | source]
java.lang.Object
   org.apache.catalina.core.ApplicationContext

All Implemented Interfaces:
    ServletContext

Direct Known Subclasses:
    ReplApplContext

Standard implementation of ServletContext that represents a web application's execution environment. An instance of this class is associated with each instance of StandardContext.
Field Summary
protected  Map attributes    The context attributes for this context. 
Constructor:
 public ApplicationContext(String basePath,
    StandardContext context) 
    Construct a new instance of this class, associated with the specified Context instance.
    Parameters:
    context - The associated Context instance
Method from org.apache.catalina.core.ApplicationContext Summary:
clearAttributes,   getAttribute,   getAttributeNames,   getContext,   getContext,   getContextPath,   getFacade,   getInitParameter,   getInitParameterNames,   getMajorVersion,   getMimeType,   getMinorVersion,   getNamedDispatcher,   getReadonlyAttributes,   getRealPath,   getRequestDispatcher,   getResource,   getResourceAsStream,   getResourcePaths,   getResources,   getServerInfo,   getServlet,   getServletContextName,   getServletNames,   getServlets,   log,   log,   log,   removeAttribute,   setAttribute,   setAttributeReadOnly
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.core.ApplicationContext Detail:
 protected  void clearAttributes() 
    Clear all application-created attributes.
 public Object getAttribute(String name) 
    Return the value of the specified context attribute, if any; otherwise return null.
 public Enumeration getAttributeNames() 
    Return an enumeration of the names of the context attributes associated with this context.
 protected StandardContext getContext() 
 public ServletContext getContext(String uri) 
    Return a ServletContext object that corresponds to a specified URI on the server. This method allows servlets to gain access to the context for various parts of the server, and as needed obtain RequestDispatcher objects or resources from the context. The given path must be absolute (beginning with a "/"), and is interpreted based on our virtual host's document root.
 public String getContextPath() 
    Return the main path associated with this context.
 protected ServletContext getFacade() 
    Return the facade associated with this ApplicationContext.
 public String getInitParameter(String name) 
    Return the value of the specified initialization parameter, or null if this parameter does not exist.
 public Enumeration getInitParameterNames() 
    Return the names of the context's initialization parameters, or an empty enumeration if the context has no initialization parameters.
 public int getMajorVersion() 
    Return the major version of the Java Servlet API that we implement.
 public String getMimeType(String file) 
    Return the MIME type of the specified file, or null if the MIME type cannot be determined.
 public int getMinorVersion() 
    Return the minor version of the Java Servlet API that we implement.
 public RequestDispatcher getNamedDispatcher(String name) 
    Return a RequestDispatcher object that acts as a wrapper for the named servlet.
 protected Map getReadonlyAttributes() 
 public String getRealPath(String path) 
    Return the real path for a given virtual path, if possible; otherwise return null.
 public RequestDispatcher getRequestDispatcher(String path) 
    Return a RequestDispatcher instance that acts as a wrapper for the resource at the given path. The path must begin with a "/" and is interpreted as relative to the current context root.
 public URL getResource(String path) throws MalformedURLException 
    Return the URL to the resource that is mapped to a specified path. The path must begin with a "/" and is interpreted as relative to the current context root.
 public InputStream getResourceAsStream(String path) 
    Return the requested resource as an InputStream. The path must be specified according to the rules described under getResource. If no such resource can be identified, return null.
 public Set getResourcePaths(String path) 
    Return a Set containing the resource paths of resources member of the specified collection. Each path will be a String starting with a "/" character. The returned set is immutable.
 public DirContext getResources() 
    Return the resources object that is mapped to a specified path. The path must begin with a "/" and is interpreted as relative to the current context root.
 public String getServerInfo() 
    Return the name and version of the servlet container.
 public Servlet getServlet(String name) 
Deprecated! As - of Java Servlet API 2.1, with no direct replacement.

 public String getServletContextName() 
    Return the display name of this web application.
 public Enumeration getServletNames() 
Deprecated! As - of Java Servlet API 2.1, with no direct replacement.

 public Enumeration getServlets() 
Deprecated! As - of Java Servlet API 2.1, with no direct replacement.

 public  void log(String message) 
    Writes the specified message to a servlet log file.
 public  void log(Exception exception,
    String message) 
Deprecated! As - of Java Servlet API 2.1, use log(String, Throwable) instead

    Writes the specified exception and message to a servlet log file.
 public  void log(String message,
    Throwable throwable) 
    Writes the specified message and exception to a servlet log file.
 public  void removeAttribute(String name) 
    Remove the context attribute with the specified name, if any.
 public  void setAttribute(String name,
    Object value) 
    Bind the specified value with the specified context attribute name, replacing any existing value for that name.
  void setAttributeReadOnly(String name) 
    Set an attribute as read only.