|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AggregateLifeCycle
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.
| 嵌套类摘要 | |
|---|---|
class |
WebAppContext.Context
|
| 从类 org.eclipse.jetty.servlet.ServletContextHandler 继承的嵌套类/接口 |
|---|
ServletContextHandler.Decorator, ServletContextHandler.JspConfig, ServletContextHandler.JspPropertyGroup, ServletContextHandler.TagLib |
| 从类 org.eclipse.jetty.server.handler.ContextHandler 继承的嵌套类/接口 |
|---|
ContextHandler.AliasCheck, ContextHandler.ApproveNonExistentDirectoryAliases, ContextHandler.ApprovePathPrefixAliases, ContextHandler.ApproveSameSuffixAliases |
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口 |
|---|
AbstractLifeCycle.AbstractLifeCycleListener |
| 从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口 |
|---|
LifeCycle.Listener |
| 字段摘要 | |
|---|---|
static String[] |
__dftServerClasses
|
static String[] |
__dftSystemClasses
|
static String |
BASETEMPDIR
|
static String |
ERROR_PAGE
|
static String |
SERVER_CONFIG
|
static String |
SERVER_SRV_CLASSES
|
static String |
SERVER_SYS_CLASSES
|
static String |
TEMPDIR
|
static String |
WEB_DEFAULTS_XML
|
| 从类 org.eclipse.jetty.servlet.ServletContextHandler 继承的字段 |
|---|
_decorators, _defaultSecurityHandlerClass, _jspConfig, _options, _restrictedContextListeners, _securityHandler, _servletHandler, _sessionHandler, _wrapper, NO_SECURITY, NO_SESSIONS, SECURITY, SESSIONS |
| 从类 org.eclipse.jetty.server.handler.ContextHandler 继承的字段 |
|---|
_scontext, MANAGED_ATTRIBUTES |
| 从类 org.eclipse.jetty.server.handler.ScopedHandler 继承的字段 |
|---|
_nextScope, _outerScope |
| 从类 org.eclipse.jetty.server.handler.HandlerWrapper 继承的字段 |
|---|
_handler |
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段 |
|---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| 构造方法摘要 | |
|---|---|
WebAppContext()
|
|
WebAppContext(HandlerContainer parent,
String webApp,
String contextPath)
|
|
WebAppContext(SessionHandler sessionHandler,
SecurityHandler securityHandler,
ServletHandler servletHandler,
ErrorHandler errorHandler)
This constructor is used in the geronimo integration. |
|
WebAppContext(String webApp,
String contextPath)
|
|
| 方法摘要 | |
|---|---|
void |
addOverrideDescriptor(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 |
addServerClass(String classname)
|
void |
addSystemClass(String classname)
|
void |
configure()
|
void |
destroy()
Destroy the joined Destroyable beans in the reverse order they were added. |
protected void |
doStart()
Start the managed lifecycle beans in the order they were added. |
protected void |
doStop()
Stop the joined lifecycle beans in the reverse order they were added. |
String[] |
getConfigurationClasses()
|
Configuration[] |
getConfigurations()
|
static WebAppContext |
getCurrentWebAppContext()
|
String[] |
getDefaultConfigurationClasses()
|
String |
getDefaultsDescriptor()
The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xml |
String[] |
getDefaultServerClasses()
|
String[] |
getDefaultSystemClasses()
|
String |
getDescriptor()
|
String |
getExtraClasspath()
|
MetaData |
getMetaData()
|
String |
getOverrideDescriptor()
已过时。 use getOverrideDescriptors() |
List<String> |
getOverrideDescriptors()
An override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml |
PermissionCollection |
getPermissions()
|
Resource |
getResource(String uriInContext)
|
String |
getResourceAlias(String path)
|
Map<String,String> |
getResourceAliases()
|
String[] |
getServerClasses()
|
String[] |
getSystemClasses()
|
File |
getTempDirectory()
|
Throwable |
getUnavailableException()
Get an exception that caused the webapp to be unavailable |
String |
getWar()
|
Resource |
getWebInf()
|
boolean |
isAllowDuplicateFragmentNames()
|
boolean |
isConfigurationDiscovered()
Is the context Automatically configured. |
boolean |
isCopyWebDir()
|
boolean |
isCopyWebInf()
|
boolean |
isDistributable()
|
boolean |
isExtractWAR()
|
boolean |
isLogUrlOnStart()
|
boolean |
isParentLoaderPriority()
|
boolean |
isServerClass(String name)
Is the class a Server Class. |
boolean |
isSystemClass(String name)
Is the class a System Class. |
boolean |
isThrowUnavailableOnStartupException()
|
protected void |
loadConfigurations()
|
protected void |
loadSystemClasses()
|
void |
postConfigure()
|
void |
preConfigure()
Pre configure the web application. |
String |
removeResourceAlias(String alias)
|
void |
setAllowDuplicateFragmentNames(boolean allowDuplicateFragmentNames)
|
void |
setClassLoader(ClassLoader classLoader)
|
void |
setConfigurationClasses(String[] configurations)
|
void |
setConfigurationDiscovered(boolean discovered)
Set the configuration discovery mode. |
void |
setConfigurations(Configuration[] configurations)
|
void |
setContextWhiteList(String[] contextWhiteList)
Set the context white list In certain circumstances you want may want to deny access of one webapp from another when you may not fully trust the webapp. |
void |
setCopyWebDir(boolean copy)
|
void |
setCopyWebInf(boolean copyWebInf)
|
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 |
void |
setDescriptor(String descriptor)
|
void |
setDisplayName(String servletContextName)
|
void |
setDistributable(boolean distributable)
|
void |
setEventListeners(EventListener[] eventListeners)
Set the context event listeners. |
void |
setExtraClasspath(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(String overrideDescriptor)
已过时。 use setOverrideDescriptors(List) |
void |
setOverrideDescriptors(List<String> overrideDescriptors)
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(PermissionCollection permissions)
|
void |
setResourceAlias(String alias,
String uri)
Set Resource Alias. |
void |
setResourceAliases(Map<String,String> map)
|
void |
setServer(Server server)
|
void |
setServerClasses(String[] serverClasses)
Set the server classes patterns. |
Set<String> |
setServletSecurity(ServletRegistration.Dynamic registration,
ServletSecurityElement servletSecurityElement)
Delegate for ServletRegistration.Dynamic.setServletSecurity method |
void |
setSystemClasses(String[] systemClasses)
Set the system classes patterns. |
void |
setTempDirectory(File dir)
Set temporary directory for context. |
void |
setThrowUnavailableOnStartupException(boolean throwIfStartupException)
|
void |
setWar(String war)
|
protected void |
startContext()
Finish constructing handlers and link them together. |
String |
toString()
|
| 从类 org.eclipse.jetty.server.handler.ScopedHandler 继承的方法 |
|---|
handle, never, nextHandle, nextScope |
| 从类 org.eclipse.jetty.server.handler.HandlerWrapper 继承的方法 |
|---|
expandChildren, getHandler, getHandlers, getNestedHandlerByClass, setHandler |
| 从类 org.eclipse.jetty.server.handler.AbstractHandlerContainer 继承的方法 |
|---|
expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass |
| 从类 org.eclipse.jetty.server.handler.AbstractHandler 继承的方法 |
|---|
dumpThis, getServer |
| 从类 org.eclipse.jetty.util.component.AggregateLifeCycle 继承的方法 |
|---|
addBean, addBean, contains, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, unmanage |
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法 |
|---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 从接口 org.eclipse.jetty.webapp.WebAppClassLoader.Context 继承的方法 |
|---|
newResource |
| 从接口 org.eclipse.jetty.server.Handler 继承的方法 |
|---|
getServer, handle |
| 从接口 org.eclipse.jetty.util.component.LifeCycle 继承的方法 |
|---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| 字段详细信息 |
|---|
public static final String TEMPDIR
public static final String BASETEMPDIR
public static final String WEB_DEFAULTS_XML
public static final String ERROR_PAGE
public static final String SERVER_CONFIG
public static final String SERVER_SYS_CLASSES
public static final String SERVER_SRV_CLASSES
public static final String[] __dftSystemClasses
public static final String[] __dftServerClasses
| 构造方法详细信息 |
|---|
public WebAppContext()
public WebAppContext(String webApp,
String contextPath)
contextPath - The context pathwebApp - The URL or filename of the webapp directory or war file.
public WebAppContext(HandlerContainer parent,
String webApp,
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)
sessionHandler - SessionHandler for this web appsecurityHandler - SecurityHandler for this web appservletHandler - ServletHandler for this web apperrorHandler - ErrorHandler for this web app| 方法详细信息 |
|---|
public static WebAppContext getCurrentWebAppContext()
public void setDisplayName(String servletContextName)
ContextHandler 中的 setDisplayNameservletContextName - The servletContextName to set.public Throwable getUnavailableException()
public void setResourceAlias(String alias,
String uri)
alias - uri - public Map<String,String> getResourceAliases()
public void setResourceAliases(Map<String,String> map)
public String getResourceAlias(String path)
public String removeResourceAlias(String alias)
public void setClassLoader(ClassLoader classLoader)
ContextHandler 中的 setClassLoaderclassLoader - The classLoader to set.
public Resource getResource(String uriInContext)
throws MalformedURLException
ContextHandler 中的 getResourceMalformedURLExceptionpublic boolean isConfigurationDiscovered()
public void setConfigurationDiscovered(boolean discovered)
discovered - true if configuration discovery is enabled for automatic configuration from the context
public void preConfigure()
throws Exception
The method is normally called from AbstractLifeCycle.start(). It performs
the discovery of the configurations to be applied to this context,
specifically:
Configuration instances with a call to loadConfigurations().
loadSystemClasses()
loadServerClasses()
Configuration.preConfigure(WebAppContext) method of all
Configuration instances.
Exception
public void configure()
throws Exception
Exception
public void postConfigure()
throws Exception
Exception
protected void doStart()
throws Exception
AggregateLifeCycle 复制的描述
ContextHandler 中的 doStartExceptionHandlerWrapper.doStart()
protected void doStop()
throws Exception
AggregateLifeCycle 复制的描述
ServletContextHandler 中的 doStopExceptionContextHandler.doStop()public void destroy()
AggregateLifeCycle 复制的描述
Handler 中的 destroyDestroyable 中的 destroyHandlerWrapper 中的 destroyDestroyable.destroy()public String[] getConfigurationClasses()
public Configuration[] getConfigurations()
public String getDefaultsDescriptor()
@Deprecated public String getOverrideDescriptor()
getOverrideDescriptors()
public List<String> getOverrideDescriptors()
public PermissionCollection getPermissions()
WebAppClassLoader.Context 中的 getPermissionspublic String[] getServerClasses()
setServerClasses(String[])public void addServerClass(String classname)
public String[] getSystemClasses()
setSystemClasses(String[])public void addSystemClass(String classname)
public boolean isServerClass(String name)
WebAppClassLoader.Context 复制的描述
WebAppClassLoader.Context 中的 isServerClassname - The fully qualified name of the class.
public boolean isSystemClass(String name)
WebAppClassLoader.Context 复制的描述
WebAppClassLoader.Context 中的 isSystemClassname - The fully qualified name of the class.
protected void loadSystemClasses()
public String getWar()
public Resource getWebInf()
throws IOException
IOExceptionpublic boolean isDistributable()
public boolean isExtractWAR()
public boolean isCopyWebDir()
public boolean isCopyWebInf()
public boolean isParentLoaderPriority()
WebAppClassLoader.Context 中的 isParentLoaderPrioritypublic String[] getDefaultConfigurationClasses()
public String[] getDefaultServerClasses()
public String[] getDefaultSystemClasses()
protected void loadConfigurations()
throws Exception
Exceptionpublic String toString()
ContextHandler 中的 toStringpublic void setConfigurationClasses(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(String defaultsDescriptor)
defaultsDescriptor - The defaultsDescriptor to set.@Deprecated public void setOverrideDescriptor(String overrideDescriptor)
setOverrideDescriptors(List)
overrideDescriptor - The overrideDescritpor to set.public void setOverrideDescriptors(List<String> overrideDescriptors)
overrideDescriptors - The overrideDescriptors (file or URL) to set.public void addOverrideDescriptor(String overrideDescriptor)
overrideDescriptor - The overrideDescriptor (file or URL) to add.public String getDescriptor()
public void setDescriptor(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(EventListener[] eventListeners)
ContextHandler 复制的描述
ContextHandler 中的 setEventListenerseventListeners - the event listenersServletContextListener,
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 setCopyWebInf(boolean copyWebInf)
copyWebInf - True if the web-inf lib and classes directories are copied (to allow hot replacement of jars on windows)public void setParentLoaderPriority(boolean java2compliant)
java2compliant - The java2compliant to set.public void setPermissions(PermissionCollection permissions)
permissions - The permissions to set.public void setContextWhiteList(String[] contextWhiteList)
contextWhiteList - public void setServerClasses(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(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(File dir)
dir - Writable temporary directory.public File getTempDirectory()
public void setWar(String war)
war - The war to set as a file name or URLpublic String getExtraClasspath()
WebAppClassLoader.Context 中的 getExtraClasspathpublic void setExtraClasspath(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)
Handler 中的 setServerContextHandler 中的 setServerpublic boolean isAllowDuplicateFragmentNames()
public void setAllowDuplicateFragmentNames(boolean allowDuplicateFragmentNames)
public void setThrowUnavailableOnStartupException(boolean throwIfStartupException)
public boolean isThrowUnavailableOnStartupException()
protected void startContext()
throws Exception
ServletContextHandler 复制的描述
ServletContextHandler 中的 startContextExceptionContextHandler.startContext()
public Set<String> setServletSecurity(ServletRegistration.Dynamic registration,
ServletSecurityElement servletSecurityElement)
ServletContextHandler 复制的描述
ServletContextHandler 中的 setServletSecurityregistration - ServletRegistration.Dynamic instance that setServletSecurity was called onservletSecurityElement - new security info
public MetaData getMetaData()
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||