|
|||||||||
| 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.DefaultForwardResolution
public class DefaultForwardResolution
Forward a request. Forwarded resources are located by default inside /WEB-INF/jsp to prevent direct browser access.
| Constructor Summary | |
|---|---|
DefaultForwardResolution()
|
|
| Method Summary | |
|---|---|
ForwardResolution |
addCookie(javax.servlet.http.Cookie cookie)
Adds a cookie |
ForwardResolution |
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). |
ForwardResolution |
addCookie(java.lang.String name,
java.lang.String value,
int maxAge)
Adds a cookie |
ForwardResolution |
addHeader(java.lang.String name,
java.lang.Object value)
Add a http header. |
java.lang.String |
calculateTargetResource(LoomServletRequest request)
|
java.lang.String |
getDestination()
|
java.lang.String |
getForwardResourcesRoot()
|
void |
resolve(LoomServletRequest request,
LoomServletResponse response)
Write the response contents |
ForwardResolution |
set(java.lang.String name,
java.lang.Object value)
Set a request-scoped attribute. |
ForwardResolution |
setAttribute(java.lang.String name,
java.lang.Object value)
Set a request-scoped attribute. |
ForwardResolution |
setCacheControl(CacheControl cacheControl)
Sets the cache data to be sent to the browser |
ForwardResolution |
setCharset(java.lang.String charset)
Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8. |
ForwardResolution |
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. |
void |
setDestination(java.lang.String resource)
|
void |
setForwardResourcesRoot(java.lang.String forwardResourcesRoot)
|
ForwardResolution |
setHeader(java.lang.String name,
java.lang.Object value)
Set a String http header. |
ForwardResolution |
setHeaderIfNotPresent(java.lang.String name,
java.lang.Object value)
Set a String http header if it has not been set. |
java.lang.String |
toString()
|
| 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, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultForwardResolution()
| Method Detail |
|---|
public void resolve(LoomServletRequest request,
LoomServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
Resolution
resolve in interface Resolutionresolve in class AbstractHttpResolutionrequest - the current request objectresponse - the current response object
java.io.IOException
javax.servlet.ServletExceptionpublic java.lang.String calculateTargetResource(LoomServletRequest request)
public java.lang.String getDestination()
public void setDestination(java.lang.String resource)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getForwardResourcesRoot()
public void setForwardResourcesRoot(java.lang.String forwardResourcesRoot)
public ForwardResolution set(java.lang.String name,
java.lang.Object value)
ForwardResolution
set in interface ForwardResolutionname - the name of the attribute to setvalue - the value of the attribute
public ForwardResolution setAttribute(java.lang.String name,
java.lang.Object value)
ForwardResolution
setAttribute in interface ForwardResolutionname - the name of the attribute to setvalue - the value of the attribute
public ForwardResolution addCookie(java.lang.String name,
java.lang.String value)
HttpResolution
addCookie in interface ForwardResolutionaddCookie in interface HttpResolutionaddCookie in class AbstractHttpResolutionname - the name of the cookievalue - the value of the Cookie
public ForwardResolution addCookie(java.lang.String name,
java.lang.String value,
int maxAge)
HttpResolution
addCookie in interface ForwardResolutionaddCookie in interface HttpResolutionaddCookie 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 ForwardResolution addCookie(javax.servlet.http.Cookie cookie)
HttpResolution
addCookie in interface ForwardResolutionaddCookie in interface HttpResolutionaddCookie in class AbstractHttpResolutioncookie - the cookie to be added to the response
public ForwardResolution addHeader(java.lang.String name,
java.lang.Object value)
HttpResolution
addHeader in interface ForwardResolutionaddHeader in interface HttpResolutionaddHeader 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 ForwardResolution setHeader(java.lang.String name,
java.lang.Object value)
HttpResolution
setHeader in interface ForwardResolutionsetHeader in interface HttpResolutionsetHeader in class AbstractHttpResolutionname - the name of the http headervalue - the value of the http header
public ForwardResolution setHeaderIfNotPresent(java.lang.String name,
java.lang.Object value)
HttpResolution
setHeaderIfNotPresent in interface ForwardResolutionsetHeaderIfNotPresent in interface HttpResolutionsetHeaderIfNotPresent in class AbstractHttpResolutionname - the name of the http headervalue - the value of the http headerpublic ForwardResolution setCharset(java.lang.String charset)
HttpResolution
setCharset in interface ForwardResolutionsetCharset in interface HttpResolutionsetCharset in class AbstractHttpResolutionpublic ForwardResolution setContentType(java.lang.String contentType)
HttpResolutiontext/html;charset=UTF-8.
Notice that #setCharset(String) can also be used for this.
setContentType in interface ForwardResolutionsetContentType in interface HttpResolutionsetContentType in class AbstractHttpResolutionpublic ForwardResolution setCacheControl(CacheControl cacheControl)
CacheableResolution
setCacheControl in interface CacheableResolutionsetCacheControl in interface ForwardResolutionsetCacheControl in interface HttpResolutionsetCacheControl in class AbstractHttpResolutioncacheControl - the cache data.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||