|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.server.handler.AbstractHandler
org.eclipse.jetty.server.handler.AbstractHandlerContainer
org.eclipse.jetty.server.handler.HandlerWrapper
org.eclipse.jetty.server.handler.ScopedHandler
org.eclipse.jetty.server.handler.ContextHandler
org.eclipse.jetty.servlet.ServletContextHandler
org.eclipse.jetty.webapp.WebAppContext
public class WebAppContext
Web Application Context Handler.
The WebAppContext handler is an extension of ContextHandler that
coordinates the construction and configuration of nested handlers:
ConstraintSecurityHandler, SessionHandler
and ServletHandler.
The handlers are configured by pluggable configuration classes, with
the default being WebXmlConfiguration and
JettyWebXmlConfiguration.
| Nested Class Summary | |
|---|---|
class |
WebAppContext.Context
|
| Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
|---|
AbstractLifeCycle.AbstractLifeCycleListener |
| Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle |
|---|
LifeCycle.Listener |
| Field Summary | |
|---|---|
static java.lang.String |
ERROR_PAGE
|
static java.lang.String |
SERVER_CONFIG
|
static java.lang.String |
SERVER_SRV_CLASSES
|
static java.lang.String |
SERVER_SYS_CLASSES
|
static java.lang.String |
TEMPDIR
|
static java.lang.String |
WEB_DEFAULTS_XML
|
| Fields inherited from class org.eclipse.jetty.servlet.ServletContextHandler |
|---|
_defaultSecurityHandlerClass, _options, _securityHandler, _servletHandler, _sessionHandler, NO_SECURITY, NO_SESSIONS, SECURITY, SESSIONS |
| Fields inherited from class org.eclipse.jetty.server.handler.ContextHandler |
|---|
_scontext, MANAGED_ATTRIBUTES |
| Fields inherited from class org.eclipse.jetty.server.handler.ScopedHandler |
|---|
_nextScope, _outerScope |
| Fields inherited from class org.eclipse.jetty.server.handler.HandlerWrapper |
|---|
_handler |
| Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
|---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| Constructor Summary | |
|---|---|
WebAppContext()
|
|
WebAppContext(HandlerContainer parent,
java.lang.String webApp,
java.lang.String contextPath)
|
|
WebAppContext(SessionHandler sessionHandler,
SecurityHandler securityHandler,
ServletHandler servletHandler,
ErrorHandler errorHandler)
|
|
WebAppContext(java.lang.String webApp,
java.lang.String contextPath)
|
|
| Method Summary | |
|---|---|
void |
addEventListener(java.util.EventListener listener)
Add EventListener Conveniance method that calls setEventListeners(EventListener[]) |
void |
addServerClass(java.lang.String classname)
|
void |
addSystemClass(java.lang.String classname)
|
protected void |
doStart()
|
protected void |
doStop()
|
void |
dumpUrl()
|
java.lang.String[] |
getConfigurationClasses()
|
Configuration[] |
getConfigurations()
|
static WebAppContext |
getCurrentWebAppContext()
|
java.lang.String[] |
getDefaultConfigurationClasses()
|
java.lang.String |
getDefaultsDescriptor()
The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xml |
java.lang.String |
getDescriptor()
|
java.lang.String |
getExtraClasspath()
|
java.lang.String |
getOverrideDescriptor()
The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml |
java.security.PermissionCollection |
getPermissions()
|
Resource |
getResource(java.lang.String uriInContext)
|
java.lang.String |
getResourceAlias(java.lang.String alias)
|
java.util.Map |
getResourceAliases()
|
java.lang.String[] |
getServerClasses()
|
java.lang.String[] |
getSystemClasses()
|
java.io.File |
getTempDirectory()
|
java.lang.Throwable |
getUnavailableException()
Get an exception that caused the webapp to be unavailable |
java.lang.String |
getWar()
|
Resource |
getWebInf()
|
boolean |
isConfigurationDiscovered()
Is the context Automatically configured. |
boolean |
isCopyWebDir()
|
boolean |
isDistributable()
|
boolean |
isExtractWAR()
|
boolean |
isLogUrlOnStart()
|
boolean |
isParentLoaderPriority()
|
protected boolean |
isProtectedTarget(java.lang.String target)
Check the target. |
boolean |
isServerClass(java.lang.String name)
|
boolean |
isSystemClass(java.lang.String name)
|
protected void |
loadConfigurations()
|
java.lang.String |
removeResourceAlias(java.lang.String alias)
|
void |
setClassLoader(java.lang.ClassLoader classLoader)
|
void |
setConfigurationClasses(java.lang.String[] configurations)
|
void |
setConfigurationDiscovered(boolean discovered)
Set the configuration discovery mode. |
void |
setConfigurations(Configuration[] configurations)
|
void |
setCopyWebDir(boolean copy)
|
void |
setDefaultsDescriptor(java.lang.String defaultsDescriptor)
The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xml |
void |
setDescriptor(java.lang.String descriptor)
|
void |
setDisplayName(java.lang.String servletContextName)
|
void |
setDistributable(boolean distributable)
|
void |
setEventListeners(java.util.EventListener[] eventListeners)
Set the context event listeners. |
void |
setExtraClasspath(java.lang.String extraClasspath)
|
void |
setExtractWAR(boolean extractWAR)
|
void |
setLogUrlOnStart(boolean logOnStart)
Sets whether or not the web app name and URL is logged on startup |
void |
setOverrideDescriptor(java.lang.String overrideDescriptor)
The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml |
void |
setParentLoaderPriority(boolean java2compliant)
|
void |
setPermissions(java.security.PermissionCollection permissions)
|
void |
setResourceAlias(java.lang.String alias,
java.lang.String uri)
Set Resource Alias. |
void |
setResourceAliases(java.util.Map map)
|
void |
setServer(Server server)
|
void |
setServerClasses(java.lang.String[] serverClasses)
Set the server classes patterns. |
void |
setSystemClasses(java.lang.String[] systemClasses)
Set the system classes patterns. |
void |
setTempDirectory(java.io.File dir)
Set temporary directory for context. |
void |
setWar(java.lang.String war)
|
protected void |
startContext()
Finish constructing handlers and link them together. |
java.lang.String |
toString()
|
| Methods inherited from class org.eclipse.jetty.servlet.ServletContextHandler |
|---|
addFilter, addFilter, addFilter, addServlet, addServlet, addServlet, getDefaultSecurityHandlerClass, getSecurityHandler, getServletHandler, getSessionHandler, newSecurityHandler, newServletHandler, newSessionHandler, setDefaultSecurityHandlerClass, setSecurityHandler, setServletHandler, setSessionHandler |
| Methods inherited from class org.eclipse.jetty.server.handler.ScopedHandler |
|---|
handle, nextHandle, nextScope |
| Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper |
|---|
expandChildren, getHandler, getHandlers, setHandler |
| Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer |
|---|
dump, expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass |
| Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler |
|---|
destroy, dump, getServer |
| Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
|---|
addLifeCycleListener, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.jetty.server.Handler |
|---|
destroy, getServer, handle |
| Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle |
|---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| Field Detail |
|---|
public static final java.lang.String TEMPDIR
public static final java.lang.String WEB_DEFAULTS_XML
public static final java.lang.String ERROR_PAGE
public static final java.lang.String SERVER_CONFIG
public static final java.lang.String SERVER_SYS_CLASSES
public static final java.lang.String SERVER_SRV_CLASSES
| Constructor Detail |
|---|
public WebAppContext()
public WebAppContext(java.lang.String webApp,
java.lang.String contextPath)
contextPath - The context pathwebApp - The URL or filename of the webapp directory or war file.
public WebAppContext(HandlerContainer parent,
java.lang.String webApp,
java.lang.String contextPath)
parent - The parent HandlerContainer.contextPath - The context pathwebApp - The URL or filename of the webapp directory or war file.
public WebAppContext(SessionHandler sessionHandler,
SecurityHandler securityHandler,
ServletHandler servletHandler,
ErrorHandler errorHandler)
| Method Detail |
|---|
public static WebAppContext getCurrentWebAppContext()
public void setDisplayName(java.lang.String servletContextName)
setDisplayName in class ContextHandlerservletContextName - The servletContextName to set.public java.lang.Throwable getUnavailableException()
public void setResourceAlias(java.lang.String alias,
java.lang.String uri)
alias - uri - public java.util.Map getResourceAliases()
public void setResourceAliases(java.util.Map map)
public java.lang.String getResourceAlias(java.lang.String alias)
public java.lang.String removeResourceAlias(java.lang.String alias)
public void setClassLoader(java.lang.ClassLoader classLoader)
setClassLoader in class ContextHandlerclassLoader - The classLoader to set.
public Resource getResource(java.lang.String uriInContext)
throws java.net.MalformedURLException
getResource in class ContextHandlerjava.net.MalformedURLExceptionpublic boolean isConfigurationDiscovered()
public void setConfigurationDiscovered(boolean discovered)
discovered - true if configuration discovery is enabled for automatic configuration from the context
protected void doStart()
throws java.lang.Exception
doStart in class ContextHandlerjava.lang.ExceptionHandlerWrapper.doStart()public void dumpUrl()
protected void doStop()
throws java.lang.Exception
doStop in class ContextHandlerjava.lang.Exceptionpublic java.lang.String[] getConfigurationClasses()
public Configuration[] getConfigurations()
public java.lang.String getDefaultsDescriptor()
public java.lang.String getOverrideDescriptor()
public java.security.PermissionCollection getPermissions()
public java.lang.String[] getServerClasses()
setServerClasses(String[])public void addServerClass(java.lang.String classname)
public java.lang.String[] getSystemClasses()
setSystemClasses(String[])public void addSystemClass(java.lang.String classname)
public boolean isServerClass(java.lang.String name)
public boolean isSystemClass(java.lang.String name)
public java.lang.String getWar()
public Resource getWebInf()
throws java.io.IOException
java.io.IOExceptionpublic boolean isDistributable()
public boolean isExtractWAR()
public boolean isCopyWebDir()
public boolean isParentLoaderPriority()
public java.lang.String[] getDefaultConfigurationClasses()
protected void loadConfigurations()
throws java.lang.Exception
java.lang.Exceptionprotected boolean isProtectedTarget(java.lang.String target)
ContextHandlerScopedHandler.handle(String, Request, HttpServletRequest, HttpServletResponse) when a
target within a context is determined. If the target is protected, 404 is returned.
The default implementation always returns false.
isProtectedTarget in class ContextHandlerpublic java.lang.String toString()
toString in class ContextHandlerpublic void setConfigurationClasses(java.lang.String[] configurations)
configurations - The configuration class names. If setConfigurations is not called
these classes are used to create a configurations array.public void setConfigurations(Configuration[] configurations)
configurations - The configurations to set.public void setDefaultsDescriptor(java.lang.String defaultsDescriptor)
defaultsDescriptor - The defaultsDescriptor to set.public void setOverrideDescriptor(java.lang.String overrideDescriptor)
overrideDescriptor - The overrideDescritpor to set.public java.lang.String getDescriptor()
public void setDescriptor(java.lang.String descriptor)
descriptor - the web.xml descriptor to use. If set to null, WEB-INF/web.xml is used if it exists.public void setDistributable(boolean distributable)
distributable - The distributable to set.public void setEventListeners(java.util.EventListener[] eventListeners)
ContextHandler
setEventListeners in class ContextHandlerServletContextListener,
ServletContextAttributeListener,
ServletRequestListener,
ServletRequestAttributeListenerpublic void addEventListener(java.util.EventListener listener)
setEventListeners(EventListener[])
addEventListener in class ContextHandlerlistener - ServletContextListener,
ServletContextAttributeListener,
ServletRequestListener,
ServletRequestAttributeListenerpublic void setExtractWAR(boolean extractWAR)
extractWAR - True if war files are extractedpublic void setCopyWebDir(boolean copy)
copy - True if the webdir is copied (to allow hot replacement of jars)public void setParentLoaderPriority(boolean java2compliant)
java2compliant - The java2compliant to set.public void setPermissions(java.security.PermissionCollection permissions)
permissions - The permissions to set.public void setServerClasses(java.lang.String[] serverClasses)
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:
serverClasses - The serverClasses to set.public void setSystemClasses(java.lang.String[] systemClasses)
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 setParentLoaderPriority(boolean).
A class pattern is a string of one of the forms:
systemClasses - The systemClasses to set.public void setTempDirectory(java.io.File dir)
dir - Writable temporary directory.public java.io.File getTempDirectory()
public void setWar(java.lang.String war)
war - The war to set as a file name or URLpublic java.lang.String getExtraClasspath()
public void setExtraClasspath(java.lang.String extraClasspath)
extraClasspath - Comma or semicolon separated path of filenames or URLs
pointing to directories or jar files. Directories should end
with '/'.public boolean isLogUrlOnStart()
public void setLogUrlOnStart(boolean logOnStart)
logOnStart - whether or not the log message is createdpublic void setServer(Server server)
setServer in interface HandlersetServer in class ContextHandler
protected void startContext()
throws java.lang.Exception
ServletContextHandler
startContext in class ServletContextHandlerjava.lang.ExceptionContextHandler.startContext()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||