|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mortbay.jetty.handler.ContextHandler.SContext
org.mortbay.jetty.servlet.Context.SContext
public class Context.SContext
Constructor Summary | |
---|---|
Context.SContext()
|
Method Summary | |
---|---|
void |
addFilter(String filterName,
String description,
String className,
Map<String,String> initParameters)
Adds the filter with the given name, description, and class name to this servlet context. |
void |
addFilterMapping(String filterName,
String[] urlPatterns,
String[] servletNames,
EnumSet<DispatcherType> dispatcherTypes,
boolean isMatchAfter)
Adds a filter mapping with the given url patterns, servlet names, and dispatcher types for the filter with the given filter name to this servlet context. |
void |
addServlet(String servletName,
String description,
String className,
Map<String,String> initParameters,
int loadOnStartup)
Adds the servlet with the given name, description, and class name to this servlet context. |
void |
addServletMapping(String servletName,
String[] urlPattern)
Adds a servlet mapping with the given url patterns for the servlet with the given servlet name to this servlet context. |
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 |
---|
public Context.SContext()
Method Detail |
---|
public RequestDispatcher getNamedDispatcher(String name)
javax.servlet.ServletContext
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.
getNamedDispatcher
in interface ServletContext
getNamedDispatcher
in class ContextHandler.SContext
name
- a String
specifying the name
of a servlet to wrap
RequestDispatcher
object
that acts as a wrapper for the named servlet,
or null
if the ServletContext
cannot return a RequestDispatcher
RequestDispatcher
,
ServletContext.getContext(java.lang.String)
,
ServletConfig.getServletName()
public RequestDispatcher getRequestDispatcher(String uriInContext)
javax.servlet.ServletContext
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
.
getRequestDispatcher
in interface ServletContext
getRequestDispatcher
in class ContextHandler.SContext
uriInContext
- a String
specifying the pathname
to the resource
RequestDispatcher
object
that acts as a wrapper for the resource
at the specified path, or null
if
the ServletContext
cannot return
a RequestDispatcher
RequestDispatcher
,
ServletContext.getContext(java.lang.String)
public void addFilter(String filterName, String description, String className, Map<String,String> initParameters)
javax.servlet.ServletContext
addFilter
in interface ServletContext
addFilter
in class ContextHandler.SContext
filterName
- the name of the filterdescription
- the description of the filterclassName
- the fully qualified class name of the filterinitParameters
- the initialization parameters of the filter,
or null if the filter does not need anypublic void addFilterMapping(String filterName, String[] urlPatterns, String[] servletNames, EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter)
javax.servlet.ServletContext
The filter with the given name may have been declared in the
deployment descriptor or one of the web fragments of this servlet
context, or may be added using addFilter
. It is
legal to add a filter mapping for a filter that has not yet been added.
Filter mappings added via this method will be matched against requests in the same order in which they were added.
Depending on the value of the isMatchAfter parameter, the given filter mapping will be considered after or before any declared filter mappings of this servlet context.
addFilterMapping
in interface ServletContext
addFilterMapping
in class ContextHandler.SContext
filterName
- the name of the filter for which the filter
mapping is addedurlPatterns
- the url patterns of the filter mappingservletNames
- the servlet names of the filter mappingdispatcherTypes
- the dispatcher types of the filter mapping,
or null if the default DispatcherType.REQUEST is to be usedisMatchAfter
- true if the given filter mapping should be matched
against requests after any declared filter mappings of this servlet
context, and false if it is supposed to be matched before any declared
filter mappings of this servlet contextpublic void addServlet(String servletName, String description, String className, Map<String,String> initParameters, int loadOnStartup)
javax.servlet.ServletContext
If loadOnStartup is a positive integer or zero, it
indicates to the container the initialization priority of the
servlet. In this case, the container must instantiate and initialize
the servlet during the initialization phase of this servlet context,
that is, after it has invoked all of the ServletContextListeners
configured for this servlet context at their
ServletContextListener.contextInitialized(javax.servlet.ServletContextEvent)
method.
If loadOnStartup is a negative integer, the container is free to instantiate and initialize the servlet lazily.
addServlet
in interface ServletContext
addServlet
in class ContextHandler.SContext
servletName
- the name of the servletdescription
- the description of the servletclassName
- the fully qualified class name of the servletinitParameters
- the initialization parameters of the servlet,
or null if the servlet does not need anyloadOnStartup
- the initialization priority of the servletpublic void addServletMapping(String servletName, String[] urlPattern)
javax.servlet.ServletContext
The servlet with the given name may have been declared in the
deployment descriptor or one of the web fragments of this servlet
context, or may be added using addServlet
. It is
legal to add a servlet mapping for a servlet that has not yet been
added.
addServletMapping
in interface ServletContext
addServletMapping
in class ContextHandler.SContext
servletName
- the name of the servlet for which the servlet
mapping is addedurlPattern
- the url patterns of the servlet mapping
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |