|
|||||||||
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.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 Resolution
resolve
in class AbstractHttpResolution
request
- the current request objectresponse
- the current response object
java.io.IOException
javax.servlet.ServletException
public 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.Object
public 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 ForwardResolution
name
- 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 ForwardResolution
name
- 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 ForwardResolution
addCookie
in interface HttpResolution
addCookie
in class AbstractHttpResolution
name
- the name of the cookievalue
- the value of the Cookiepublic ForwardResolution addCookie(java.lang.String name, java.lang.String value, int maxAge)
HttpResolution
addCookie
in interface ForwardResolution
addCookie
in interface HttpResolution
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 ForwardResolution addCookie(javax.servlet.http.Cookie cookie)
HttpResolution
addCookie
in interface ForwardResolution
addCookie
in interface HttpResolution
addCookie
in class AbstractHttpResolution
cookie
- the cookie to be added to the responsepublic ForwardResolution addHeader(java.lang.String name, java.lang.Object value)
HttpResolution
addHeader
in interface ForwardResolution
addHeader
in interface HttpResolution
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 ForwardResolution setHeader(java.lang.String name, java.lang.Object value)
HttpResolution
setHeader
in interface ForwardResolution
setHeader
in interface HttpResolution
setHeader
in class AbstractHttpResolution
name
- the name of the http headervalue
- the value of the http headerpublic ForwardResolution setHeaderIfNotPresent(java.lang.String name, java.lang.Object value)
HttpResolution
setHeaderIfNotPresent
in interface ForwardResolution
setHeaderIfNotPresent
in interface HttpResolution
setHeaderIfNotPresent
in class AbstractHttpResolution
name
- the name of the http headervalue
- the value of the http headerpublic ForwardResolution setCharset(java.lang.String charset)
HttpResolution
setCharset
in interface ForwardResolution
setCharset
in interface HttpResolution
setCharset
in class AbstractHttpResolution
public ForwardResolution setContentType(java.lang.String contentType)
HttpResolution
text/html;charset=UTF-8
.
Notice that #setCharset(String) can also be used for this.
setContentType
in interface ForwardResolution
setContentType
in interface HttpResolution
setContentType
in class AbstractHttpResolution
public ForwardResolution setCacheControl(CacheControl cacheControl)
CacheableResolution
setCacheControl
in interface CacheableResolution
setCacheControl
in interface ForwardResolution
setCacheControl
in interface HttpResolution
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 |