|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openqa.jetty.util.Container
org.openqa.jetty.http.HttpContext
org.openqa.jetty.jetty.servlet.ServletHttpContext
org.openqa.jetty.jetty.servlet.WebApplicationContext
public class WebApplicationContext
Standard web.xml configured HttpContext. This specialization of HttpContext uses the standardized web.xml to describe a web application and configure the handlers for the HttpContext. If a file named web-jetty.xml or jetty-web.xml is found in the WEB-INF directory it is applied to the context using the XmlConfiguration format. A single WebApplicationHandler instance is used to provide security, filter, sevlet and resource handling.
WebApplicationHandler
,
Serialized FormNested Class Summary | |
---|---|
static interface |
WebApplicationContext.Configuration
Base Class for WebApplicationContext Configuration. |
Field Summary |
---|
Fields inherited from class org.openqa.jetty.http.HttpContext |
---|
__ErrorHandler, __fileClassPathAttr |
Constructor Summary | |
---|---|
WebApplicationContext()
Constructor. |
|
WebApplicationContext(String webApp)
Constructor. |
Method Summary | |
---|---|
void |
addEventListener(EventListener listener)
Add a server event listener. |
protected void |
configureClassPath()
|
protected void |
configureDefaults()
|
protected void |
configureWebApp()
|
void |
destroy()
Destroy a context. |
protected void |
doStart()
Start the Web Application. |
protected void |
doStop()
Stop the web application. |
String[] |
getConfigurationClassNames()
|
WebApplicationContext.Configuration[] |
getConfigurations()
|
String |
getDefaultsDescriptor()
|
String |
getDisplayName()
|
String |
getErrorPage(String error)
get error page URI. |
boolean |
getExtractWAR()
|
Resource |
getResource(String uriInContext)
|
String |
getResourceAlias(String alias)
|
Map |
getResourceAliases()
|
ServletHandler |
getServletHandler()
Get the context ServletHandler. |
protected UserRealm |
getUserRealm(String name)
|
String |
getWAR()
|
WebApplicationHandler |
getWebApplicationHandler()
|
Resource |
getWebInf()
|
void |
handle(String pathInContext,
String pathParams,
HttpRequest httpRequest,
HttpResponse httpResponse)
Handler request. |
protected void |
initialize()
Initialize is called by the start method after the contexts classloader has been initialied, but before the defaults descriptor has been applied. |
boolean |
isDistributable()
|
boolean |
isIgnoreWebJetty()
|
protected WebApplicationContext.Configuration[] |
loadConfigurations()
|
void |
readExternal(ObjectInput in)
|
String |
removeErrorPage(String error)
|
void |
removeEventListener(EventListener listener)
|
String |
removeResourceAlias(String alias)
|
void |
setConfigurationClassNames(String[] configurationClassNames)
|
void |
setDefaultsDescriptor(String defaults)
Set the defaults web.xml file. |
void |
setDisplayName(String name)
|
void |
setDistributable(boolean distributable)
|
void |
setErrorPage(String error,
String uriInContext)
set error page URI. |
void |
setExtractWAR(boolean extract)
|
void |
setIgnoreWebJetty(boolean b)
|
void |
setPermissions(PermissionCollection permissions)
Set the permissions to be used for this context. |
void |
setResourceAlias(String alias,
String uri)
Set Resource Alias. |
void |
setWAR(String war)
|
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class org.openqa.jetty.jetty.servlet.ServletHttpContext |
---|
addLocaleEncoding, addServlet, addServlet, checkSecurityConstraints, enterContextScope, getLocaleEncoding, getServletContext, jSecurityCheck, sendError |
Methods inherited from class org.openqa.jetty.util.Container |
---|
addComponent, getComponents, isStarted, isStarting, isStopping, removeComponent, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.openqa.jetty.util.LifeCycle |
---|
isStarted, start, stop |
Constructor Detail |
---|
public WebApplicationContext()
public WebApplicationContext(String webApp)
webApp
- The Web application directory or WAR file.Method Detail |
---|
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void setConfigurationClassNames(String[] configurationClassNames)
public String[] getConfigurationClassNames()
public void setWAR(String war)
war
- Filename or URL of the web application directory or WAR file.public String getWAR()
public WebApplicationHandler getWebApplicationHandler()
public Resource getWebInf() throws IOException
IOException
public ServletHandler getServletHandler()
getServletHandler
in class ServletHttpContext
public void setPermissions(PermissionCollection permissions)
HttpContext
setPermissions
in class HttpContext
public boolean isIgnoreWebJetty()
public void setIgnoreWebJetty(boolean b)
b
- If TRUE, web-jetty.xml and jetty-web.xml configuration
files are ignored.public boolean isDistributable()
public void setDistributable(boolean distributable)
public WebApplicationContext.Configuration[] getConfigurations()
protected WebApplicationContext.Configuration[] loadConfigurations() throws Exception
Exception
protected void configureClassPath() throws Exception
Exception
protected void configureDefaults() throws Exception
Exception
protected void configureWebApp() throws Exception
Exception
protected void doStart() throws Exception
doStart
in class HttpContext
IOException
Exception
protected void doStop() throws Exception
doStop
in class ServletHttpContext
InterruptedException
Exception
public void destroy()
HttpContext
destroy
in class ServletHttpContext
public void handle(String pathInContext, String pathParams, HttpRequest httpRequest, HttpResponse httpResponse) throws HttpException, IOException
HttpContext
handle
in interface HttpHandler
handle
in class HttpContext
pathInContext
- Path in contextpathParams
- Path parameters such as encoded Session IDhttpRequest
- The HttpRequest requesthttpResponse
- The HttpResponse response
HttpException
IOException
public void addEventListener(EventListener listener) throws IllegalArgumentException
Container
addEventListener
in interface EventProvider
addEventListener
in class Container
listener
- ComponentEventListener or LifeCycleEventListener
IllegalArgumentException
- If the EventListener type is not supported.public void removeEventListener(EventListener listener)
removeEventListener
in interface EventProvider
removeEventListener
in class Container
public String getDisplayName()
public void setDisplayName(String name)
public void setDefaultsDescriptor(String defaults)
defaults
- File, Resource, URL or null.public String getDefaultsDescriptor()
public void setExtractWAR(boolean extract)
extract
- If true, a WAR is extracted to a temporary
directory before being deployed.public boolean getExtractWAR()
protected void initialize() throws Exception
Exception
- if an error occursprotected UserRealm getUserRealm(String name)
public String toString()
toString
in class ServletHttpContext
public void setResourceAlias(String alias, String uri)
alias
- uri
- public Map getResourceAliases()
public String getResourceAlias(String alias)
public String removeResourceAlias(String alias)
public Resource getResource(String uriInContext) throws IOException
getResource
in class HttpContext
IOException
public void setErrorPage(String error, String uriInContext)
error
- A string representing an error code or a
exception classnameuriInContext
- public String getErrorPage(String error)
error
- A string representing an error code or a
exception classname
public String removeErrorPage(String error)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |