|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jetty.server.handler.ContextHandler.Context
org.eclipse.jetty.servlet.ServletContextHandler.Context
org.eclipse.jetty.webapp.WebAppContext.Context
public class WebAppContext.Context
Constructor Summary | |
---|---|
WebAppContext.Context()
|
Method Summary | |
---|---|
ServletContext |
getContext(String uripath)
Returns a ServletContext object that
corresponds to a specified URL on the server. |
URL |
getResource(String path)
Returns a URL to the resource that is mapped to a specified path. |
Methods inherited from class org.eclipse.jetty.servlet.ServletContextHandler.Context |
---|
addFilter, addFilter, addFilter, addListener, addListener, addListener, addServlet, addServlet, addServlet, createFilter, createListener, createServlet, declareRoles, getFilterRegistration, getFilterRegistrations, getNamedDispatcher, getServletRegistration, getServletRegistrations, setInitParameter |
Methods inherited from class org.eclipse.jetty.server.handler.ContextHandler.Context |
---|
getAttribute, getAttributeNames, getContextHandler, getContextPath, getInitParameter, getInitParameterNames, getMajorVersion, getMimeType, getMinorVersion, getRealPath, getRequestDispatcher, 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 WebAppContext.Context()
Method Detail |
---|
public URL getResource(String path) throws MalformedURLException
ServletContext
This method allows the servlet container to make a resource
available to servlets from any source. Resources
can be located on a local or remote
file system, in a database, or in a .war
file.
The servlet container must implement the URL handlers
and URLConnection
objects that are necessary
to access the resource.
This method returns null
if no resource is mapped to the pathname.
Some containers may allow writing to the URL returned by this method using the methods of the URL class.
The resource content is returned directly, so be aware that
requesting a .jsp
page returns the JSP source code.
Use a RequestDispatcher
instead to include results of
an execution.
This method has a different purpose than
java.lang.Class.getResource
,
which looks up resources based on a class loader. This
method does not use class loaders.
getResource
in interface ServletContext
getResource
in class ContextHandler.Context
path
- a String
specifying
the path to the resource
null
if there is no resource
at that path
MalformedURLException
- if the pathname is not given in
the correct formpublic ServletContext getContext(String uripath)
ServletContext
ServletContext
object that
corresponds to a specified URL 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 from the context.
The given path must be begin with "/", is interpreted relative
to the server's document root and is matched against the context roots of
other web applications hosted on this container.
In a security conscious environment, the servlet container may
return null
for a given URL.
getContext
in interface ServletContext
getContext
in class ContextHandler.Context
uripath
- a String
specifying the context path of
another web application in the container.
ServletContext
object that
corresponds to the named URL, or null if either
none exists or the container wishes to restrict
this access.RequestDispatcher
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |