org.eclipse.jetty.webapp
类 WebAppContext.Context

java.lang.Object
  继承者 org.eclipse.jetty.server.handler.ContextHandler.Context
      继承者 org.eclipse.jetty.servlet.ServletContextHandler.Context
          继承者 org.eclipse.jetty.webapp.WebAppContext.Context
所有已实现的接口:
ServletContext
包容类:
WebAppContext

public class WebAppContext.Context
extends ServletContextHandler.Context


字段摘要
 
从类 org.eclipse.jetty.server.handler.ContextHandler.Context 继承的字段
_enabled, _majorVersion, _minorVersion
 
从接口 javax.servlet.ServletContext 继承的字段
ORDERED_LIBS, TEMPDIR
 
构造方法摘要
WebAppContext.Context()
           
 
方法摘要
 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 the given path.
 
从类 org.eclipse.jetty.servlet.ServletContextHandler.Context 继承的方法
addFilter, addFilter, addFilter, addListener, addListener, addListener, addServlet, addServlet, addServlet, createFilter, createListener, createServlet, declareRoles, getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, getFilterRegistration, getFilterRegistrations, getJspConfigDescriptor, getNamedDispatcher, getServletRegistration, getServletRegistrations, getSessionCookieConfig, setInitParameter, setJspConfigDescriptor, setSessionTrackingModes
 
从类 org.eclipse.jetty.server.handler.ContextHandler.Context 继承的方法
getAttribute, getAttributeNames, getClassLoader, 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
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

WebAppContext.Context

public WebAppContext.Context()
方法详细信息

getResource

public URL getResource(String path)
                throws MalformedURLException
从接口 ServletContext 复制的描述
Returns a URL to the resource that is mapped to the given path.

The 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.

指定者:
接口 ServletContext 中的 getResource
覆盖:
ContextHandler.Context 中的 getResource
参数:
path - a String specifying the path to the resource
返回:
the resource located at the named path, or null if there is no resource at that path
抛出:
MalformedURLException - if the pathname is not given in the correct form

getContext

public ServletContext getContext(String uripath)
从接口 ServletContext 复制的描述
Returns a 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.

指定者:
接口 ServletContext 中的 getContext
覆盖:
ContextHandler.Context 中的 getContext
参数:
uripath - a String specifying the context path of another web application in the container.
返回:
the ServletContext object that corresponds to the named URL, or null if either none exists or the container wishes to restrict this access.
另请参见:
RequestDispatcher


Copyright © 2013. All Rights Reserved.