|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
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 RedirectResolution
name
- 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 RedirectResolution
name
- the name of the parametervalue
- the value of the parameter
public RedirectResolution addProperty(java.lang.String property)
RedirectResolution
addProperty
in interface RedirectResolution
property
- the name of the action property to be added.
public RedirectResolution addPropertyParameter(java.lang.String propertyName)
RedirectResolution
addPropertyParameter
in interface RedirectResolution
propertyName
- the name of the action property to be added.
public RedirectResolution setHash(java.lang.String hash)
RedirectResolution
setHash
in interface RedirectResolution
hash
- The hash to be added
public void resolve(LoomServletRequest request, LoomServletResponse response) throws java.io.IOException
Resolution
resolve
in interface Resolution
resolve
in class AbstractHttpResolution
request
- the current request objectresponse
- the current response object
java.io.IOException
public RedirectResolution permanent()
RedirectResolution
permanent
in interface RedirectResolution
public boolean isPermanent()
public java.util.List<java.lang.String> remove(java.lang.String name)
RedirectResolution
remove
in interface RedirectResolution
name
- the name of the Parameter to remove
public java.util.List<java.lang.String> removeParameter(java.lang.String name)
RedirectResolution
removeParameter
in interface RedirectResolution
name
- the name of the Parameter to remove
public RedirectResolution replace(java.lang.String name, java.lang.Object value)
RedirectResolution
replace
in interface RedirectResolution
name
- 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 RedirectResolution
name
- 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 RedirectResolution
scheme
- 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 RedirectResolution
public RedirectResolution setPort(java.lang.Integer port)
RedirectResolution
setPort
in interface RedirectResolution
public RedirectResolution setIncludeRequestParameters(boolean addCurrentRequestParameters)
RedirectResolution
RedirectResolution
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 HttpResolution
addCookie
in interface RedirectResolution
addCookie
in class AbstractHttpResolution
name
- the name of the cookievalue
- the value of the Cookiepublic RedirectResolution addCookie(java.lang.String name, java.lang.String value, int maxAge)
HttpResolution
addCookie
in interface HttpResolution
addCookie
in interface RedirectResolution
addCookie
in class AbstractHttpResolution
name
- 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 HttpResolution
addCookie
in interface RedirectResolution
addCookie
in class AbstractHttpResolution
cookie
- the cookie to be added to the responsepublic RedirectResolution addHeader(java.lang.String name, java.lang.Object value)
HttpResolution
addHeader
in interface HttpResolution
addHeader
in interface RedirectResolution
addHeader
in class AbstractHttpResolution
name
- 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 HttpResolution
setHeader
in interface RedirectResolution
setHeader
in class AbstractHttpResolution
name
- the name of the http headervalue
- the value of the http headerpublic RedirectResolution setHeaderIfNotPresent(java.lang.String name, java.lang.Object value)
HttpResolution
setHeaderIfNotPresent
in interface HttpResolution
setHeaderIfNotPresent
in interface RedirectResolution
setHeaderIfNotPresent
in class AbstractHttpResolution
name
- the name of the http headervalue
- the value of the http headerpublic RedirectResolution setCharset(java.lang.String charset)
HttpResolution
setCharset
in interface HttpResolution
setCharset
in interface RedirectResolution
setCharset
in class AbstractHttpResolution
public RedirectResolution setContentType(java.lang.String contentType)
HttpResolution
text/html;charset=UTF-8
.
Notice that #setCharset(String) can also be used for this.
setContentType
in interface HttpResolution
setContentType
in interface RedirectResolution
setContentType
in class AbstractHttpResolution
public RedirectResolution setCacheControl(CacheControl cacheControl)
CacheableResolution
setCacheControl
in interface CacheableResolution
setCacheControl
in interface HttpResolution
setCacheControl
in interface RedirectResolution
setCacheControl
in class AbstractHttpResolution
cacheControl
- the cache data.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |