Top Description Inners Fields Constructors Methods
org.mortbay.jetty.handler

public Class MovedContextHandler

extends ContextHandler
Class Inheritance
Imports
java.io.IOException, javax.servlet.ServletException, javax.servlet.http.HttpServletRequest, .HttpServletResponse, org.mortbay.jetty.HandlerContainer, .HttpConnection, .HttpHeaders, .Request, org.mortbay.util.URIUtil

Moved ContextHandler. This context can be used to replace a context that has changed location. Requests are redirected (either to a fixed URL or to a new context base).

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv boolean
pack-priv String
pack-priv String
pack-priv boolean
pack-priv MovedContextHandler.Redirector
Inherited from org.mortbay.jetty.handler.ContextHandler:
_scontextMANAGED_ATTRIBUTES

Constructor Summary

AccessConstructor and Description
public
public
MovedContextHandler(HandlerContainer parent, String contextPath, String newContextURL)

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the expires header value or null if no expires header
getExpires
()

public String
public boolean
public boolean
public boolean
public void
setDiscardPathInfo(boolean discardPathInfo)

public void
setDiscardQuery(boolean discardQuery)

public void
setExpires(String
the expires header value or null if no expires header
expires
)

public void
setNewContextURL(String newContextURL)

public void
setPermanent(boolean permanent)

Inherited from org.mortbay.jetty.handler.ContextHandler:
addEventListeneraddLocaleEncodingclearAttributescompletedoStartdoStopgetAllowNullPathInfogetAttributegetAttributeNamesgetAttributesgetBaseResourcegetClassLoadergetClassPathgetConnectorNamesgetContextPathgetCurrentContextgetDisplayNamegetErrorHandlergetEventListenersgetHostsgetInitParametergetInitParameterNamesgetInitParamsgetLocaleEncodinggetLoggergetMaxFormContentSizegetMimeTypesgetResourcegetResourceBasegetResourcePathsgetServletContextgetVirtualHostsgetWelcomeFileshandleisAliasesisCompactPathisProtectedTargetisShutdownloadClassnewResourcenewResourceremoveAttributesetAliasessetAllowNullPathInfosetAttributesetAttributessetBaseResourcesetClassLoadersetCompactPathsetConnectorNamessetContextPathsetDisplayNamesetErrorHandlersetEventListenerssetHostssetInitParamssetLoggersetMaxFormContentSizesetMimeTypessetResourceBasesetServersetShutdownsetVirtualHostssetWelcomeFilesstartContexttoString

Field Detail

_discardPathInfoback to summary
pack-priv boolean _discardPathInfo
_discardQueryback to summary
pack-priv boolean _discardQuery
_expiresback to summary
pack-priv String _expires
_newContextURLback to summary
pack-priv String _newContextURL
_permanentback to summary
pack-priv boolean _permanent
_redirectorback to summary
pack-priv MovedContextHandler.Redirector _redirector

Constructor Detail

MovedContextHandlerback to summary
public MovedContextHandler()
MovedContextHandlerback to summary
public MovedContextHandler(HandlerContainer parent, String contextPath, String newContextURL)

Method Detail

getExpiresback to summary
public String getExpires()
Returns:String

the expires header value or null if no expires header

getNewContextURLback to summary
public String getNewContextURL()
isDiscardPathInfoback to summary
public boolean isDiscardPathInfo()
isDiscardQueryback to summary
public boolean isDiscardQuery()
isPermanentback to summary
public boolean isPermanent()
setDiscardPathInfoback to summary
public void setDiscardPathInfo(boolean discardPathInfo)
setDiscardQueryback to summary
public void setDiscardQuery(boolean discardQuery)
setExpiresback to summary
public void setExpires(String expires)
Parameters
expires:String

the expires header value or null if no expires header

setNewContextURLback to summary
public void setNewContextURL(String newContextURL)
setPermanentback to summary
public void setPermanent(boolean permanent)
org.mortbay.jetty.handler back to summary

private Class MovedContextHandler.Redirector

extends AbstractHandler
Class Inheritance

Field Summary

Inherited from org.mortbay.jetty.handler.AbstractHandler:
_string

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
handle(String
The target of the request - either a URI or a name.
target
,
HttpServletRequest
The request either as the Request object or a wrapper of that request. The HttpConnection#getCurrentConnection() method can be used access the Request object if required.
request
,
HttpServletResponse
The response as the Response object or a wrapper of that request. The HttpConnection#getCurrentConnection() method can be used access the Response object if required.
response
,
int
The dispatch mode: REQUEST, FORWARD, INCLUDE, ERROR
dispatch
)

Implements org.mortbay.jetty.Handler.handle.

Handle a request.
Inherited from org.mortbay.jetty.handler.AbstractHandler:
destroydoStartdoStopgetServersetServertoString

Constructor Detail

Redirectorback to summary
private Redirector()

Method Detail

handleback to summary
public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException

Implements org.mortbay.jetty.Handler.handle.

Doc from org.mortbay.jetty.Handler.handle.

Handle a request.

Parameters
target:String

The target of the request - either a URI or a name.

request:HttpServletRequest

The request either as the Request object or a wrapper of that request. The HttpConnection#getCurrentConnection() method can be used access the Request object if required.

response:HttpServletResponse

The response as the Response object or a wrapper of that request. The HttpConnection#getCurrentConnection() method can be used access the Response object if required.

dispatch:int

The dispatch mode: REQUEST, FORWARD, INCLUDE, ERROR