|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.loom.resolution.AbstractHttpResolution
org.loom.resolution.RedirectResolutionImpl
public class RedirectResolutionImpl
Redirect resolution implementation.
| Constructor Summary | |
|---|---|
RedirectResolutionImpl(java.lang.Class<? extends Action> actionClass,
java.lang.String event)
|
|
RedirectResolutionImpl(java.lang.String url)
|
|
RedirectResolutionImpl(java.lang.String action,
java.lang.String event)
|
|
| Method Summary | |
|---|---|
RedirectResolution |
add(java.lang.String name,
java.lang.Object value)
Add a parameter to the redirected url |
RedirectResolution |
addCookie(javax.servlet.http.Cookie cookie)
Adds a cookie |
RedirectResolution |
addCookie(java.lang.String name,
java.lang.String value)
Adds a cookie that will not be stored on disk (will be deleted when the browser is closed). |
RedirectResolution |
addCookie(java.lang.String name,
java.lang.String value,
int maxAge)
Adds a cookie |
RedirectResolution |
addHeader(java.lang.String name,
java.lang.Object value)
Add a http header. |
RedirectResolution |
addParameter(java.lang.String name,
java.lang.Object value)
Add a parameter to the redirected url |
RedirectResolution |
addProperty(java.lang.String property)
Add an action property as a parameter. |
RedirectResolution |
addPropertyParameter(java.lang.String propertyName)
Add an action property as a parameter. |
boolean |
isPermanent()
|
RedirectResolution |
permanent()
Invoke this method to perform a permanent redirect (301) instead of a temporary redirect (302). |
java.util.List<java.lang.String> |
remove(java.lang.String name)
Remove a GET parameter |
java.util.List<java.lang.String> |
removeParameter(java.lang.String name)
Remove a GET parameter |
RedirectResolution |
replace(java.lang.String name,
java.lang.Object value)
Replace a parameter value. |
RedirectResolution |
replaceParameter(java.lang.String name,
java.lang.Object value)
Replace a parameter value. |
void |
resolve(LoomServletRequest request,
LoomServletResponse response)
Write the response contents |
RedirectResolution |
setCacheControl(CacheControl cacheControl)
Sets the cache data to be sent to the browser |
RedirectResolution |
setCharset(java.lang.String charset)
Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8. |
RedirectResolution |
setContentType(java.lang.String contentType)
Sets the content type of the response being sent to the client, if the response has not been committed yet. |
RedirectResolution |
setHash(java.lang.String hash)
Add a hash to the URL. |
RedirectResolution |
setHeader(java.lang.String name,
java.lang.Object value)
Set a String http header. |
RedirectResolution |
setHeaderIfNotPresent(java.lang.String name,
java.lang.Object value)
Set a String http header if it has not been set. |
RedirectResolution |
setHostname(java.lang.String hostname)
Set to not null to override the request server name |
RedirectResolution |
setIncludeRequestParameters(boolean addCurrentRequestParameters)
true to append to the generated URL all current request parameters, default false. |
RedirectResolution |
setPort(java.lang.Integer port)
Set to not null to override the request port |
RedirectResolution |
setScheme(java.lang.String scheme)
Set to not null to override the request scheme. |
| Methods inherited from class org.loom.resolution.AbstractHttpResolution |
|---|
addDateHeader, addIntHeader, containsHeader, getCacheControl, getCharset, getContentType, setDateHeader, setDateHeaderIfNotPresent, setIntHeader, setIntHeaderIfNotPresent, setJsonHeader, writeHeaders |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RedirectResolutionImpl(java.lang.String url)
public RedirectResolutionImpl(java.lang.String action,
java.lang.String event)
public RedirectResolutionImpl(java.lang.Class<? extends Action> actionClass,
java.lang.String event)
| Method Detail |
|---|
public RedirectResolution add(java.lang.String name,
java.lang.Object value)
RedirectResolution
add in interface RedirectResolutionname - the name of the parametervalue - the value of the parameter
public RedirectResolution addParameter(java.lang.String name,
java.lang.Object value)
RedirectResolution
addParameter in interface RedirectResolutionname - the name of the parametervalue - the value of the parameter
public RedirectResolution addProperty(java.lang.String property)
RedirectResolution
addProperty in interface RedirectResolutionproperty - the name of the action property to be added.
public RedirectResolution addPropertyParameter(java.lang.String propertyName)
RedirectResolution
addPropertyParameter in interface RedirectResolutionpropertyName - the name of the action property to be added.
public RedirectResolution setHash(java.lang.String hash)
RedirectResolution
setHash in interface RedirectResolutionhash - The hash to be added
public void resolve(LoomServletRequest request,
LoomServletResponse response)
throws java.io.IOException
Resolution
resolve in interface Resolutionresolve in class AbstractHttpResolutionrequest - the current request objectresponse - the current response object
java.io.IOExceptionpublic RedirectResolution permanent()
RedirectResolution
permanent in interface RedirectResolutionpublic boolean isPermanent()
public java.util.List<java.lang.String> remove(java.lang.String name)
RedirectResolution
remove in interface RedirectResolutionname - the name of the Parameter to remove
public java.util.List<java.lang.String> removeParameter(java.lang.String name)
RedirectResolution
removeParameter in interface RedirectResolutionname - the name of the Parameter to remove
public RedirectResolution replace(java.lang.String name,
java.lang.Object value)
RedirectResolution
replace in interface RedirectResolutionname - the name of the parameter to be replaced.value - the new value of the parameter. If null, the parameter will just be removed.
public RedirectResolution replaceParameter(java.lang.String name,
java.lang.Object value)
RedirectResolution
replaceParameter in interface RedirectResolutionname - the name of the parameter to be replaced.value - the new value of the parameter. If null, the parameter will just be removed.public RedirectResolution setScheme(java.lang.String scheme)
RedirectResolution
setScheme in interface RedirectResolutionscheme - the scheme name, without colon: "http", "https", etc.
Use the empty String to generate a protocol-less URL, e.g. "//myhost.com/resource.html"public RedirectResolution setHostname(java.lang.String hostname)
RedirectResolution
setHostname in interface RedirectResolutionpublic RedirectResolution setPort(java.lang.Integer port)
RedirectResolution
setPort in interface RedirectResolutionpublic RedirectResolution setIncludeRequestParameters(boolean addCurrentRequestParameters)
RedirectResolutionRedirectResolution instance will override the value included in the request.
setIncludeRequestParameters in interface RedirectResolution
public RedirectResolution addCookie(java.lang.String name,
java.lang.String value)
HttpResolution
addCookie in interface HttpResolutionaddCookie in interface RedirectResolutionaddCookie in class AbstractHttpResolutionname - the name of the cookievalue - the value of the Cookie
public RedirectResolution addCookie(java.lang.String name,
java.lang.String value,
int maxAge)
HttpResolution
addCookie in interface HttpResolutionaddCookie in interface RedirectResolutionaddCookie in class AbstractHttpResolutionname - the name of the cookievalue - the value of the CookiemaxAge - can be positive (number of seconds that it will be stored in
the browser), zero (to delete the cookie from the browser) or
a negative value (to indicate that the cookie should not be
stored in disk and will be forgotten when the browser exists).public RedirectResolution addCookie(javax.servlet.http.Cookie cookie)
HttpResolution
addCookie in interface HttpResolutionaddCookie in interface RedirectResolutionaddCookie in class AbstractHttpResolutioncookie - the cookie to be added to the response
public RedirectResolution addHeader(java.lang.String name,
java.lang.Object value)
HttpResolution
addHeader in interface HttpResolutionaddHeader in interface RedirectResolutionaddHeader in class AbstractHttpResolutionname - the name of the http headervalue - the value of the http header. Date, int and String are supported. Anything else will be cast to toString(). Null will be ignored.
public RedirectResolution setHeader(java.lang.String name,
java.lang.Object value)
HttpResolution
setHeader in interface HttpResolutionsetHeader in interface RedirectResolutionsetHeader in class AbstractHttpResolutionname - the name of the http headervalue - the value of the http header
public RedirectResolution setHeaderIfNotPresent(java.lang.String name,
java.lang.Object value)
HttpResolution
setHeaderIfNotPresent in interface HttpResolutionsetHeaderIfNotPresent in interface RedirectResolutionsetHeaderIfNotPresent in class AbstractHttpResolutionname - the name of the http headervalue - the value of the http headerpublic RedirectResolution setCharset(java.lang.String charset)
HttpResolution
setCharset in interface HttpResolutionsetCharset in interface RedirectResolutionsetCharset in class AbstractHttpResolutionpublic RedirectResolution setContentType(java.lang.String contentType)
HttpResolutiontext/html;charset=UTF-8.
Notice that #setCharset(String) can also be used for this.
setContentType in interface HttpResolutionsetContentType in interface RedirectResolutionsetContentType in class AbstractHttpResolutionpublic RedirectResolution setCacheControl(CacheControl cacheControl)
CacheableResolution
setCacheControl in interface CacheableResolutionsetCacheControl in interface HttpResolutionsetCacheControl in interface RedirectResolutionsetCacheControl in class AbstractHttpResolutioncacheControl - the cache data.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||