|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.request.Response org.apache.wicket.request.http.WebResponse
public abstract class WebResponse
Base class for web-related responses.
Nested Class Summary | |
---|---|
static class |
WebResponse.CacheScope
caching scope for data Unless the data is confidential, session-specific or user-specific the general advice is to prefer value PUBLIC for best network performance. |
Field Summary | |
---|---|
static Duration |
MAX_CACHE_DURATION
Recommended value for cache duration |
Constructor Summary | |
---|---|
WebResponse()
|
Method Summary | |
---|---|
abstract void |
addCookie(javax.servlet.http.Cookie cookie)
Add a cookie to the web response |
abstract void |
addHeader(java.lang.String name,
java.lang.String value)
Add a value to the servlet response stream. |
abstract void |
clearCookie(javax.servlet.http.Cookie cookie)
Convenience method for clearing a cookie. |
void |
disableCaching()
Make this response non-cacheable |
void |
enableCaching(Duration duration,
WebResponse.CacheScope scope)
Make this response cacheable |
abstract java.lang.String |
encodeRedirectURL(java.lang.CharSequence url)
Encodes urls used to redirect. |
abstract void |
flush()
Flushes the response. |
abstract boolean |
isRedirect()
|
abstract void |
sendError(int sc,
java.lang.String msg)
Send error status code with optional message. |
abstract void |
sendRedirect(java.lang.String url)
Redirects the response to specified URL. |
void |
setAttachmentHeader(java.lang.String filename)
Convenience method for setting the content-disposition:attachment header. |
abstract void |
setContentLength(long length)
Set the content length on the response, if appropriate in the subclass. |
abstract void |
setContentType(java.lang.String mimeType)
Set the content type on the response, if appropriate in the subclass. |
abstract void |
setDateHeader(java.lang.String name,
Time date)
Set a header to the date value in the servlet response stream. |
abstract void |
setHeader(java.lang.String name,
java.lang.String value)
Set a header to the string value in the servlet response stream. |
void |
setInlineHeader(java.lang.String filename)
Convenience method for setting the content-disposition:inline header. |
void |
setLastModifiedTime(Time time)
Set the contents last modified time, if appropriate in the subclass. |
abstract void |
setStatus(int sc)
Sets the status code for this response. |
Methods inherited from class org.apache.wicket.request.Response |
---|
close, encodeURL, getContainerResponse, reset, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Duration MAX_CACHE_DURATION
Constructor Detail |
---|
public WebResponse()
Method Detail |
---|
public abstract void addCookie(javax.servlet.http.Cookie cookie)
cookie
- public abstract void clearCookie(javax.servlet.http.Cookie cookie)
cookie
- The cookie to setaddCookie(Cookie)
public abstract void setHeader(java.lang.String name, java.lang.String value)
name
- value
- public abstract void addHeader(java.lang.String name, java.lang.String value)
name
- value
- public abstract void setDateHeader(java.lang.String name, Time date)
name
- date
- public abstract void setContentLength(long length)
length
- The length of the contentpublic abstract void setContentType(java.lang.String mimeType)
mimeType
- The mime typepublic void setLastModifiedTime(Time time)
time
- The last modified timepublic void setAttachmentHeader(java.lang.String filename)
filename
- file name of the attachmentpublic void setInlineHeader(java.lang.String filename)
filename
- file name of the attachmentpublic abstract void setStatus(int sc)
sc
- status codepublic abstract void sendError(int sc, java.lang.String msg)
sc
- msg
-
java.io.IOException
public abstract java.lang.String encodeRedirectURL(java.lang.CharSequence url)
Response.encodeURL(CharSequence)
.
url
-
public abstract void sendRedirect(java.lang.String url)
url
parameters
throu the #encodeRedirectURL(String)
method.
url
- public abstract boolean isRedirect()
true
is sendRedirect(String)
was called, false
otherwise.public abstract void flush()
public void disableCaching()
public void enableCaching(Duration duration, WebResponse.CacheScope scope)
duration
- maximum duration before the response must be invalidated by any caches. It should
not exceed one year, based on RFC-2616.scope
- controls which caches are allowed to cache the responseMAX_CACHE_DURATION
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |