org.mortbay.jetty.security.ConstraintsSecurityHandler, org.mortbay.jetty.servlet.SessionHandler
and org.mortbay.jetty.servlet.ServletHandler.
The handlers are configured by pluggable configuration classes, with
the default being org.mortbay.jetty.webapp.WebXmlConfiguration and
org.mortbay.jetty.webapp.JettyWebXmlConfiguration.
| Modifier and Type | Field and Description |
|---|---|
| private static String[] | |
| private String[] | |
| private Configuration[] | |
| private boolean | |
| private String | |
| private String | |
| private boolean | |
| private String | |
| private boolean | |
| private boolean | |
| private boolean | |
| private String | |
| private transient boolean | |
| private boolean | |
| private PermissionCollection | |
| private transient Map | |
| private String[] | |
| private String[] | |
| private File | |
| private transient boolean | |
| private Throwable | |
| private String | |
| public static final String | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | WebAppContext(String
The URL or filename of the webapp directory or war file. webApp, String The context path contextPath)
|
| public | WebAppContext(HandlerContainer
The parent HandlerContainer. parent, String The URL or filename of the webapp directory or war file. webApp, String The context path contextPath)
|
| public | WebAppContext(ConstraintsSecurityHandler securityHandler, SessionHandler sessionHandler, ServletHandler servletHandler, ErrorHandler errorHandler)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | addEventListener(EventListener listener)
Overrides org. setEventListeners(EventListener[])
|
| protected void | |
| protected void | |
| public void | |
| private String | |
| public String[] | |
| public Configuration[] | |
| public ConstraintsSecurityHandler | |
| public static ContextHandler | |
| public String | Returns: Returns the defaultsDescriptor.The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xml |
| public String | Returns: the web.xml descriptor to use. If set to null, WEB-INF/web.xml is used if it exists.
|
| public String | Returns: Comma or semicolon separated path of filenames or URLs pointing to directories or jar files. Directories should end with '/'.
|
| public String | Returns: Returns the Override Descriptor.The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml |
| public PermissionCollection | |
| public Resource | |
| public String | |
| public Map | |
| public String[] | |
| public String[] | |
| public File | getTempDirectory()
Get a temporary directory in which to unpack the war etc etc. The algorithm for determining this is to check these alternatives in the order shown: A. |
| public Throwable | Returns: A throwable if the webapp is unavailable or nullGet an exception that caused the webapp to be unavailable |
| public String | |
| public Resource | |
| public void | handle(String
The target of the request - either a URI or a name. target, HttpServletRequest The request either as the request, HttpServletResponse Request
object or a wrapper of that request. The HttpConnection#getCurrentConnection()
method can be used access the Request object if required.The response as the response, int dispatch)Response
object or a wrapper of that request. The HttpConnection#getCurrentConnection()
method can be used access the Response object if required.Overrides org. Implements org. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| protected boolean | isProtectedTarget(String target)
Overrides org. |
| public boolean | |
| public boolean | |
| public boolean | isTempWorkDirectory()
Check if the _tmpDir itself is called "work", or if the _tmpDir is in a directory called "work". |
| protected void | |
| public String | |
| protected void | resolveWebApp()
Resolve Web App directory If the BaseResource has not been set, use the war resource to derive a webapp resource (expanding WAR if required). |
| public void | setClassLoader(ClassLoader
The classLoader to set. classLoader)Overrides org. |
| public void | setConfigurationClasses(String[]
The configuration class names. If setConfigurations is not called
these classes are used to create a configurations array. configurations)
|
| public void | |
| public void | |
| public void | setDefaultsDescriptor(String
The defaultsDescriptor to set. defaultsDescriptor)The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xml |
| public void | setDescriptor(String
the web.xml descriptor to use. If set to null, WEB-INF/web.xml is used if it exists. descriptor)
|
| public void | setDisplayName(String
The servletContextName to set. servletContextName)Overrides org. |
| public void | |
| public void | setEventListeners(EventListener[] eventListeners)
Overrides org. |
| public void | setExtraClasspath(String
Comma or semicolon separated path of filenames or URLs
pointing to directories or jar files. Directories should end
with '/'. extraClasspath)
|
| public void | |
| public void | setLogUrlOnStart(boolean
whether or not the log message is created logOnStart)Sets whether or not the web app name and URL is logged on startup |
| public void | setOverrideDescriptor(String
The overrideDescritpor to set. overrideDescriptor)The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| protected void | |
| public String | toString()
Overrides org. |
| __dftConfigurationClasses | back to summary |
|---|---|
| private static String[] __dftConfigurationClasses | |
| _configurationClasses | back to summary |
|---|---|
| private String[] _configurationClasses | |
| _configurations | back to summary |
|---|---|
| private Configuration[] _configurations | |
| _copyDir | back to summary |
|---|---|
| private boolean _copyDir | |
| _defaultsDescriptor | back to summary |
|---|---|
| private String _defaultsDescriptor | |
| _descriptor | back to summary |
|---|---|
| private String _descriptor | |
| _distributable | back to summary |
|---|---|
| private boolean _distributable | |
| _extraClasspath | back to summary |
|---|---|
| private String _extraClasspath | |
| _extractWAR | back to summary |
|---|---|
| private boolean _extractWAR | |
| _isExistingTmpDir | back to summary |
|---|---|
| private boolean _isExistingTmpDir | |
| _logUrlOnStart | back to summary |
|---|---|
| private boolean _logUrlOnStart | |
| _overrideDescriptor | back to summary |
|---|---|
| private String _overrideDescriptor | |
| _ownClassLoader | back to summary |
|---|---|
| private transient boolean _ownClassLoader | |
| _parentLoaderPriority | back to summary |
|---|---|
| private boolean _parentLoaderPriority | |
| _permissions | back to summary |
|---|---|
| private PermissionCollection _permissions | |
| _resourceAliases | back to summary |
|---|---|
| private transient Map<K, V> _resourceAliases | |
| _serverClasses | back to summary |
|---|---|
| private String[] _serverClasses | |
| _systemClasses | back to summary |
|---|---|
| private String[] _systemClasses | |
| _tmpDir | back to summary |
|---|---|
| private File _tmpDir | |
| _unavailable | back to summary |
|---|---|
| private transient boolean _unavailable | |
| _unavailableException | back to summary |
|---|---|
| private Throwable _unavailableException | |
| _war | back to summary |
|---|---|
| private String _war | |
| ERROR_PAGE | back to summary |
|---|---|
| public static final String ERROR_PAGE | |
| WEB_DEFAULTS_XML | back to summary |
|---|---|
| public static final String WEB_DEFAULTS_XML | |
| WebAppContext | back to summary |
|---|---|
| public WebAppContext() | |
| WebAppContext | back to summary |
|---|---|
| public WebAppContext(String webApp, String contextPath) | |
| WebAppContext | back to summary |
|---|---|
public WebAppContext(HandlerContainer parent, String webApp, String contextPath)
| |
| WebAppContext | back to summary |
|---|---|
| public WebAppContext(ConstraintsSecurityHandler securityHandler, SessionHandler sessionHandler, ServletHandler servletHandler, ErrorHandler errorHandler) | |
| addEventListener | back to summary |
|---|---|
| public void addEventListener(EventListener listener) Overrides org. Add EventListener
Conveniance method that calls | |
| doStart | back to summary |
|---|---|
| protected void doStart() throws Exception | |
| doStop | back to summary |
|---|---|
| protected void doStop() throws Exception | |
| dumpUrl | back to summary |
|---|---|
| public void dumpUrl() | |
| getCanonicalNameForWebAppTmpDir | back to summary |
|---|---|
| private String getCanonicalNameForWebAppTmpDir() Create a canonical name for a webapp tmp directory. The form of the name is: "Jetty_"+host+"_"+port+"__"+resourceBase+"_"+context+"_"+virtualhost+base36 hashcode of whole string host and port uniquely identify the server context and virtual host uniquely identify the webapp | |
| getConfigurationClasses | back to summary |
|---|---|
public String[] getConfigurationClasses()
| |
| getConfigurations | back to summary |
|---|---|
public Configuration[] getConfigurations()
| |
| getConstraintsSecurityHandler | back to summary |
|---|---|
| public ConstraintsSecurityHandler getConstraintsSecurityHandler() | |
| getCurrentWebAppContext | back to summary |
|---|---|
| public static ContextHandler getCurrentWebAppContext() | |
| getDefaultsDescriptor | back to summary |
|---|---|
| public String getDefaultsDescriptor() The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xml
| |
| getDescriptor | back to summary |
|---|---|
public String getDescriptor()
| |
| getExtraClasspath | back to summary |
|---|---|
public String getExtraClasspath()
| |
| getOverrideDescriptor | back to summary |
|---|---|
| public String getOverrideDescriptor() The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml
| |
| getPermissions | back to summary |
|---|---|
public PermissionCollection getPermissions()
| |
| getResource | back to summary |
|---|---|
| public Resource getResource(String uriInContext) throws MalformedURLException Overrides org. | |
| getResourceAlias | back to summary |
|---|---|
| public String getResourceAlias(String alias) | |
| getResourceAliases | back to summary |
|---|---|
| public Map | |
| getServerClasses | back to summary |
|---|---|
public String[] getServerClasses()
| |
| getSystemClasses | back to summary |
|---|---|
public String[] getSystemClasses()
| |
| getTempDirectory | back to summary |
|---|---|
| public File getTempDirectory() Get a temporary directory in which to unpack the war etc etc. The algorithm for determining this is to check these alternatives in the order shown: A. Try to use an explicit directory specifically for this webapp:
B. Create a directory based on global settings. The new directory will be called "Jetty_"+host+"_"+port+"__"+context+"_"+virtualhost Work out where to create this directory:
| |
| getUnavailableException | back to summary |
|---|---|
| public Throwable getUnavailableException() Get an exception that caused the webapp to be unavailable
| |
| getWar | back to summary |
|---|---|
public String getWar()
| |
| getWebInf | back to summary |
|---|---|
| public Resource getWebInf() throws IOException | |
| handle | back to summary |
|---|---|
| public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException Overrides org. Implements org. Doc from org. Handle a request.
| |
| isCopyWebDir | back to summary |
|---|---|
public boolean isCopyWebDir()
| |
| isDistributable | back to summary |
|---|---|
public boolean isDistributable()
| |
| isExtractWAR | back to summary |
|---|---|
public boolean isExtractWAR()
| |
| isLogUrlOnStart | back to summary |
|---|---|
| public boolean isLogUrlOnStart() | |
| isParentLoaderPriority | back to summary |
|---|---|
public boolean isParentLoaderPriority()
| |
| isProtectedTarget | back to summary |
|---|---|
| protected boolean isProtectedTarget(String target) Overrides org. Doc from org. Check the target.
Called by | |
| isServerClass | back to summary |
|---|---|
| public boolean isServerClass(String name) | |
| isSystemClass | back to summary |
|---|---|
| public boolean isSystemClass(String name) | |
| isTempWorkDirectory | back to summary |
|---|---|
| public boolean isTempWorkDirectory() Check if the _tmpDir itself is called "work", or if the _tmpDir is in a directory called "work". | |
| loadConfigurations | back to summary |
|---|---|
| protected void loadConfigurations() throws Exception | |
| removeResourceAlias | back to summary |
|---|---|
| public String removeResourceAlias(String alias) | |
| resolveWebApp | back to summary |
|---|---|
| protected void resolveWebApp() throws IOException Resolve Web App directory If the BaseResource has not been set, use the war resource to derive a webapp resource (expanding WAR if required). | |
| setClassLoader | back to summary |
|---|---|
| public void setClassLoader(ClassLoader classLoader) Overrides org.
| |
| setConfigurationClasses | back to summary |
|---|---|
public void setConfigurationClasses(String[] configurations)
| |
| setConfigurations | back to summary |
|---|---|
public void setConfigurations(Configuration[] configurations)
| |
| setCopyWebDir | back to summary |
|---|---|
public void setCopyWebDir(boolean copy)
| |
| setDefaultsDescriptor | back to summary |
|---|---|
| public void setDefaultsDescriptor(String defaultsDescriptor) The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xml
| |
| setDescriptor | back to summary |
|---|---|
public void setDescriptor(String descriptor)
| |
| setDisplayName | back to summary |
|---|---|
| public void setDisplayName(String servletContextName) Overrides org.
| |
| setDistributable | back to summary |
|---|---|
public void setDistributable(boolean distributable)
| |
| setEventListeners | back to summary |
|---|---|
| public void setEventListeners(EventListener[] eventListeners) Overrides org. Doc from org. Set the context event listeners. | |
| setExtraClasspath | back to summary |
|---|---|
public void setExtraClasspath(String extraClasspath)
| |
| setExtractWAR | back to summary |
|---|---|
public void setExtractWAR(boolean extractWAR)
| |
| setLogUrlOnStart | back to summary |
|---|---|
| public void setLogUrlOnStart(boolean logOnStart) Sets whether or not the web app name and URL is logged on startup
| |
| setOverrideDescriptor | back to summary |
|---|---|
| public void setOverrideDescriptor(String overrideDescriptor) The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml
| |
| setParentLoaderPriority | back to summary |
|---|---|
public void setParentLoaderPriority(boolean java2compliant)
| |
| setPermissions | back to summary |
|---|---|
public void setPermissions(PermissionCollection permissions)
| |
| setResourceAlias | back to summary |
|---|---|
| public void setResourceAlias(String alias, String uri) Set Resource Alias. Resource aliases map resource uri's within a context. They may optionally be used by a handler when looking for a resource. | |
| setResourceAliases | back to summary |
|---|---|
| public void setResourceAliases(Map<K, V> map) | |
| setServerClasses | back to summary |
|---|---|
| public void setServerClasses(String[] serverClasses) Set the server classes patterns. Server classes/packages are classes used to implement the server and are hidden from the context. If the context needs to load these classes, it must have its own copy of them in WEB-INF/lib or WEB-INF/classes. A class pattern is a string of one of the forms:
| |
| setSystemClasses | back to summary |
|---|---|
| public void setSystemClasses(String[] systemClasses) Set the system classes patterns.
System classes/packages are classes provided by the JVM and that
cannot be replaced by classes of the same name from WEB-INF,
regardless of the value of
| |
| setTempDirectory | back to summary |
|---|---|
| public void setTempDirectory(File dir) Set temporary directory for context. The javax.servlet.context.tempdir attribute is also set.
| |
| setWar | back to summary |
|---|---|
public void setWar(String war)
| |
| startContext | back to summary |
|---|---|
| protected void startContext() throws Exception | |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
| |