org.loom.resolution
Interface RedirectResolution

All Superinterfaces:
CacheableResolution, HttpResolution, Resolution
All Known Implementing Classes:
RedirectResolutionImpl

public interface RedirectResolution
extends Resolution, HttpResolution

An interface implemented by redirect resolutions.


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)
          Deprecated. use add(String, Object) instead
 RedirectResolution addProperty(java.lang.String propertyName)
          Add an action property as a parameter.
 RedirectResolution addPropertyParameter(java.lang.String propertyName)
          Deprecated. use addProperty(String) instead
 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)
          Deprecated. use remove(String) instead
 RedirectResolution replace(java.lang.String name, java.lang.Object value)
          Replace a parameter value.
 RedirectResolution replaceParameter(java.lang.String name, java.lang.Object value)
          Deprecated. use replace(String, Object) instead
 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 interface org.loom.resolution.Resolution
resolve
 

Method Detail

add

RedirectResolution add(java.lang.String name,
                       java.lang.Object value)
Add a parameter to the redirected url

Parameters:
name - the name of the parameter
value - the value of the parameter
Returns:
This same instance

addParameter

RedirectResolution addParameter(java.lang.String name,
                                java.lang.Object value)
Deprecated. use add(String, Object) instead

Add a parameter to the redirected url

Parameters:
name - the name of the parameter
value - the value of the parameter
Returns:
This same instance

replace

RedirectResolution replace(java.lang.String name,
                           java.lang.Object value)
Replace a parameter value. If the parameter is multiple, all of them will be removed and a single value will be inserted instead.

Parameters:
name - the name of the parameter to be replaced.
value - the new value of the parameter. If null, the parameter will just be removed.

replaceParameter

RedirectResolution replaceParameter(java.lang.String name,
                                    java.lang.Object value)
Deprecated. use replace(String, Object) instead

Replace a parameter value. If the parameter is multiple, all of them will be removed and a single value will be inserted instead.

Parameters:
name - the name of the parameter to be replaced.
value - the new value of the parameter. If null, the parameter will just be removed.

remove

java.util.List<java.lang.String> remove(java.lang.String name)
Remove a GET parameter

Parameters:
name - the name of the Parameter to remove
Returns:
the list of removed values

removeParameter

java.util.List<java.lang.String> removeParameter(java.lang.String name)
Deprecated. use remove(String) instead

Remove a GET parameter

Parameters:
name - the name of the Parameter to remove
Returns:
the list of removed values

addProperty

RedirectResolution addProperty(java.lang.String propertyName)
Add an action property as a parameter. The property value will be retrieved from the current action and its name and value appended to the resulting URL.

Parameters:
propertyName - the name of the action property to be added.
Returns:
This same instance

addPropertyParameter

RedirectResolution addPropertyParameter(java.lang.String propertyName)
Deprecated. use addProperty(String) instead

Add an action property as a parameter. The property value will be retrieved from the current action and its name and value appended to the resulting URL.

Parameters:
propertyName - the name of the action property to be added.
Returns:
This same instance

setHash

RedirectResolution setHash(java.lang.String hash)
Add a hash to the URL. A hash is the URL part after the '#'

Parameters:
hash - The hash to be added
Returns:
This same instance

setHostname

RedirectResolution setHostname(java.lang.String hostname)
Set to not null to override the request server name


setScheme

RedirectResolution setScheme(java.lang.String scheme)
Set to not null to override the request scheme.

Parameters:
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"

setPort

RedirectResolution setPort(java.lang.Integer port)
Set to not null to override the request port


setIncludeRequestParameters

RedirectResolution setIncludeRequestParameters(boolean addCurrentRequestParameters)
true to append to the generated URL all current request parameters, default false. Parameters added to this RedirectResolution instance will override the value included in the request.


permanent

RedirectResolution permanent()
Invoke this method to perform a permanent redirect (301) instead of a temporary redirect (302).


addCookie

RedirectResolution addCookie(java.lang.String name,
                             java.lang.String value)
Description copied from interface: HttpResolution
Adds a cookie that will not be stored on disk (will be deleted when the browser is closed).

Specified by:
addCookie in interface HttpResolution
Parameters:
name - the name of the cookie
value - the value of the Cookie

addCookie

RedirectResolution addCookie(java.lang.String name,
                             java.lang.String value,
                             int maxAge)
Description copied from interface: HttpResolution
Adds a cookie

Specified by:
addCookie in interface HttpResolution
Parameters:
name - the name of the cookie
value - the value of the Cookie
maxAge - 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).

addCookie

RedirectResolution addCookie(javax.servlet.http.Cookie cookie)
Description copied from interface: HttpResolution
Adds a cookie

Specified by:
addCookie in interface HttpResolution
Parameters:
cookie - the cookie to be added to the response

addHeader

RedirectResolution addHeader(java.lang.String name,
                             java.lang.Object value)
Description copied from interface: HttpResolution
Add a http header. If the header already exists a new value will be added.

Specified by:
addHeader in interface HttpResolution
Parameters:
name - the name of the http header
value - the value of the http header. Date, int and String are supported. Anything else will be cast to toString(). Null will be ignored.

setHeader

RedirectResolution setHeader(java.lang.String name,
                             java.lang.Object value)
Description copied from interface: HttpResolution
Set a String http header. If the header already exists it will be replaced.

Specified by:
setHeader in interface HttpResolution
Parameters:
name - the name of the http header
value - the value of the http header

setHeaderIfNotPresent

RedirectResolution setHeaderIfNotPresent(java.lang.String name,
                                         java.lang.Object value)
Description copied from interface: HttpResolution
Set a String http header if it has not been set.

Specified by:
setHeaderIfNotPresent in interface HttpResolution
Parameters:
name - the name of the http header
value - the value of the http header

setCharset

RedirectResolution setCharset(java.lang.String charset)
Description copied from interface: HttpResolution
Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8.

Specified by:
setCharset in interface HttpResolution

setContentType

RedirectResolution setContentType(java.lang.String contentType)
Description copied from interface: HttpResolution
Sets the content type of the response being sent to the client, if the response has not been committed yet. The given content type may include a character encoding specification, for example, text/html;charset=UTF-8. Notice that #setCharset(String) can also be used for this.

Specified by:
setContentType in interface HttpResolution

setCacheControl

RedirectResolution setCacheControl(CacheControl cacheControl)
Description copied from interface: CacheableResolution
Sets the cache data to be sent to the browser

Specified by:
setCacheControl in interface CacheableResolution
Specified by:
setCacheControl in interface HttpResolution
Parameters:
cacheControl - the cache data.
Returns:
this same instance, to allow easy chaining of invocations