## org.mortbay.jetty.servlet
Class Context.SContext

    java.lang.Object
      org.mortbay.jetty.handler.ContextHandler.SContext
          org.mortbay.jetty.servlet.Context.SContext

All Implemented Interfaces:
  ServletContext

Enclosing class:
  Context

    public class Context.SContext

extends ContextHandler.SContext

Constructor Summary
`Context.SContext()`

Method Summary
`RequestDispatcher` `getNamedDispatcher(String name)` Returns a `RequestDispatcher` object that acts as a wrapper for the named servlet.
`RequestDispatcher` `getRequestDispatcher(String uriInContext)` Returns a `RequestDispatcher` object that acts as a wrapper for the resource located at the given path.

Methods inherited from class org.mortbay.jetty.handler.ContextHandler.SContext
`getAttribute, getAttributeNames, getContext, getContextHandler, getContextPath, getInitParameter, getInitParameterNames, getMajorVersion, getMimeType, getMinorVersion, getRealPath, 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

### Context.SContext

    public Context.SContext()

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.SContext`
  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()`

### getRequestDispatcher

    public RequestDispatcher getRequestDispatcher(String uriInContext)

  Description copied from interface: `ServletContext`
  Returns a `RequestDispatcher` object that acts as a wrapper for the resource located at the given path. A `RequestDispatcher` object can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static.

  The pathname must begin with a "/" and is interpreted as relative to the current context root. Use `getContext` to obtain a `RequestDispatcher` for resources in foreign contexts. This method returns `null` if the `ServletContext` cannot return a `RequestDispatcher`.

  Specified by:
    `getRequestDispatcher` in interface `ServletContext`
  Overrides:
    `getRequestDispatcher` in class `ContextHandler.SContext`
  Parameters:
    `uriInContext` - a `String` specifying the pathname to the resource
  Returns:
    a `RequestDispatcher` object that acts as a wrapper for the resource at the specified path, or `null` if the `ServletContext` cannot return a `RequestDispatcher`
  See Also:
    `RequestDispatcher`, `ServletContext.getContext(java.lang.String)`

Copyright © 2008 Mort Bay Consulting. All Rights Reserved.