|
||||||||||
| 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
| Field Summary |
|---|
| Fields inherited from class org.eclipse.jetty.server.handler.ContextHandler.Context |
|---|
_enabled, _majorVersion, _minorVersion |
| Fields inherited from interface javax.servlet.ServletContext |
|---|
ORDERED_LIBS, TEMPDIR |
| Constructor Summary | |
|---|---|
WebAppContext.Context()
|
|
| Method Summary | |
|---|---|
java.net.URL |
getResource(java.lang.String path)
Returns a URL to the resource that is mapped to the given path. |
| Methods inherited from class org.eclipse.jetty.server.handler.ContextHandler.Context |
|---|
getAttribute, getAttributeNames, getClassLoader, getContext, getContextHandler, getContextPath, getEffectiveMajorVersion, getEffectiveMinorVersion, getInitParameter, getInitParameterNames, getMajorVersion, getMimeType, getMinorVersion, getRealPath, getRequestDispatcher, getResourceAsStream, getResourcePaths, getServerInfo, getServlet, getServletContextName, getServletNames, getServlets, isEnabled, log, log, log, removeAttribute, setAttribute, setEffectiveMajorVersion, setEffectiveMinorVersion, setEnabled, 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 java.net.URL getResource(java.lang.String path)
throws java.net.MalformedURLException
ServletContextThe path must begin with a / and is interpreted as relative to the current context root, or relative to the /META-INF/resources directory of a JAR file inside the web application's /WEB-INF/lib directory. This method will first search the document root of the web application for the requested resource, before searching any of the JAR files inside /WEB-INF/lib. The order in which the JAR files inside /WEB-INF/lib are searched is undefined.
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 ServletContextgetResource in class ContextHandler.Contextpath - a String specifying
the path to the resource
null if there is no resource at that path
java.net.MalformedURLException - if the pathname is not given in
the correct form
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||