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:
  javax.servlet.ServletContext

Direct Known Subclasses:
  WebAppContext.Context

Enclosing class:
  ServletContextHandler

    public class ServletContextHandler.Context
    extends ContextHandler.Context

### Constructor Summary

Constructors
Constructor and Description
`ServletContextHandler.Context()`

### Method Summary

Methods
`FilterRegistration.Dynamic` `addFilter(String filterName, Class<? extends javax.servlet.Filter> filterClass)`
`FilterRegistration.Dynamic` `addFilter(String filterName, javax.servlet.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 javax.servlet.Servlet> servletClass)`
`ServletRegistration.Dynamic` `addServlet(String servletName, javax.servlet.Servlet servlet)`
`ServletRegistration.Dynamic` `addServlet(String servletName, String className)`
`<T extends javax.servlet.Filter> T` `createFilter(Class<T> c)`
`<T extends EventListener> T` `createListener(Class<T> clazz)`
`<T extends javax.servlet.Servlet> T` `createServlet(Class<T> c)`
`void` `declareRoles(String... roleNames)`
`FilterRegistration` `getFilterRegistration(String filterName)`
`Map<String,? extends FilterRegistration>` `getFilterRegistrations()`
`javax.servlet.RequestDispatcher` `getNamedDispatcher(String name)`
`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 javax.servlet.RequestDispatcher getNamedDispatcher(String name)

Specified by:
  `getNamedDispatcher` in interface `javax.servlet.ServletContext`
Overrides:
  `getNamedDispatcher` in class `ContextHandler.Context`

#### addFilter

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

Since:
  servlet-api-3.0

#### addFilter

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

Since:
  servlet-api-3.0

#### addFilter

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

Since:
  servlet-api-3.0

#### addServlet

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

Since:
  servlet-api-3.0

#### addServlet

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

Since:
  servlet-api-3.0

#### addServlet

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

Since:
  servlet-api-3.0

#### setInitParameter

    public boolean setInitParameter(String name,
                           String value)

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

#### createFilter

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

Throws:
  `javax.servlet.ServletException`

#### createServlet

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

Throws:
  `javax.servlet.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 javax.servlet.ServletException

Throws:
  `javax.servlet.ServletException`

#### declareRoles

    public void declareRoles(String... roleNames)