## org.eclipse.jetty.servlet
Class ServletContextHandler.Context

    java.lang.Object
      org.eclipse.jetty.server.handler.ContextHandler.Context
          org.eclipse.jetty.servlet.ServletContextHandler.Context

All Implemented Interfaces:
  ServletContext

Direct Known Subclasses:
  WebAppContext.Context

Enclosing class:
  ServletContextHandler

    public class ServletContextHandler.Context

extends ContextHandler.Context

Constructor Summary
`ServletContextHandler.Context()`

Method Summary
`FilterRegistration.Dynamic` `addFilter(String filterName, Class<? extends Filter> filterClass)`
`FilterRegistration.Dynamic` `addFilter(String filterName, Filter filter)`
`FilterRegistration.Dynamic` `addFilter(String filterName, String className)`
`void` `addListener(Class<? extends EventListener> listenerClass)`
`void` `addListener(String className)`

`

`<T extends EventListener> void`

`

`addListener(T t)`

`ServletRegistration.Dynamic` `addServlet(String servletName, Class<? extends Servlet> servletClass)`
`ServletRegistration.Dynamic` `addServlet(String servletName, Servlet servlet)`
`ServletRegistration.Dynamic` `addServlet(String servletName, String className)`

`

`<T extends Filter> T`

`

`createFilter(Class<T> c)`

`

`<T extends EventListener> T`

`

`createListener(Class<T> clazz)`

`

`<T extends Servlet> T`

`

`createServlet(Class<T> c)`

`void` `declareRoles(String... roleNames)`
`FilterRegistration` `getFilterRegistration(String filterName)`
`Map<String,? extends FilterRegistration>` `getFilterRegistrations()`
`RequestDispatcher` `getNamedDispatcher(String name)` Returns a `RequestDispatcher` object that acts as a wrapper for the named servlet.
`ServletRegistration` `getServletRegistration(String servletName)`
`Map<String,? extends ServletRegistration>` `getServletRegistrations()`
`boolean` `setInitParameter(String name, String value)`

Methods inherited from class org.eclipse.jetty.server.handler.ContextHandler.Context
`getAttribute, getAttributeNames, getContext, getContextHandler, getContextPath, getInitParameter, getInitParameterNames, getMajorVersion, getMimeType, getMinorVersion, getRealPath, getRequestDispatcher, getResource, getResourceAsStream, getResourcePaths, getServerInfo, getServlet, getServletContextName, getServletNames, getServlets, log, log, log, removeAttribute, setAttribute, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ServletContextHandler.Context

    public ServletContextHandler.Context()

Method Detail

### getNamedDispatcher

    public RequestDispatcher getNamedDispatcher(String name)

  Description copied from interface: `ServletContext`
  Returns a `RequestDispatcher` object that acts as a wrapper for the named servlet.

  Servlets (and JSP pages also) may be given names via server administration or via a web application deployment descriptor. A servlet instance can determine its name using `ServletConfig.getServletName()`.

  This method returns `null` if the `ServletContext` cannot return a `RequestDispatcher` for any reason.

  Specified by:
    `getNamedDispatcher` in interface `ServletContext`
  Overrides:
    `getNamedDispatcher` in class `ContextHandler.Context`
  Parameters:
    `name` - a `String` specifying the name of a servlet to wrap
  Returns:
    a `RequestDispatcher` object that acts as a wrapper for the named servlet, or `null` if the `ServletContext` cannot return a `RequestDispatcher`
  See Also:
    `RequestDispatcher`, `ServletContext.getContext(java.lang.String)`, `ServletConfig.getServletName()`

### addFilter

    public FilterRegistration.Dynamic addFilter(String filterName,
                                                Class<? extends Filter> filterClass)

  See Also:
    `javax.servlet.ServletContext#addFilter(java.lang.String, java.lang.Class)`

### addFilter

    public FilterRegistration.Dynamic addFilter(String filterName,
                                                String className)

  See Also:
    `javax.servlet.ServletContext#addFilter(java.lang.String, java.lang.String)`

### addFilter

    public FilterRegistration.Dynamic addFilter(String filterName,
                                                Filter filter)

  See Also:
    `javax.servlet.ServletContext#addFilter(java.lang.String, javax.servlet.Filter)`

### addServlet

    public ServletRegistration.Dynamic addServlet(String servletName,
                                                  Class<? extends Servlet> servletClass)

  See Also:
    `javax.servlet.ServletContext#addServlet(java.lang.String, java.lang.Class)`

### addServlet

    public ServletRegistration.Dynamic addServlet(String servletName,
                                                  String className)

  See Also:
    `javax.servlet.ServletContext#addServlet(java.lang.String, java.lang.String)`

### addServlet

    public ServletRegistration.Dynamic addServlet(String servletName,
                                                  Servlet servlet)

### setInitParameter

    public boolean setInitParameter(String name,
                                    String value)

  Overrides:
    `setInitParameter` in class `ContextHandler.Context`

### createFilter

    public <T extends Filter> T createFilter(Class<T> c)
                                  throws ServletException

  Throws:
    `ServletException`

### createServlet

    public <T extends Servlet> T createServlet(Class<T> c)
                                    throws ServletException

  Throws:
    `ServletException`

### getFilterRegistration

    public FilterRegistration getFilterRegistration(String filterName)

### getFilterRegistrations

    public Map<String,? extends FilterRegistration> getFilterRegistrations()

### getServletRegistration

    public ServletRegistration getServletRegistration(String servletName)

### getServletRegistrations

    public Map<String,? extends ServletRegistration> getServletRegistrations()

### addListener

    public void addListener(String className)

### addListener

    public <T extends EventListener> void addListener(T t)

### addListener

    public void addListener(Class<? extends EventListener> listenerClass)

### createListener

    public <T extends EventListener> T createListener(Class<T> clazz)
                                           throws ServletException

  Throws:
    `ServletException`

### declareRoles

    public void declareRoles(String... roleNames)

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.