|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Response
This interface contains all the methods that the web engine needs to be able to send a response to the client.
| Method Summary | |
|---|---|
void |
addCookie(Cookie cookie)
See HttpServletResponse.addCookie(Cookie). |
void |
addDateHeader(String name,
long date)
See HttpServletResponse.addDateHeader(String, long). |
void |
addHeader(String name,
String value)
See HttpServletResponse.addHeader(String, String). |
void |
addIntHeader(String name,
int integer)
See HttpServletResponse.addIntHeader(String, int). |
void |
clearBuffer()
Clears the text buffer is it's enabled. |
void |
close()
Closed the content output stream. |
boolean |
containsHeader(String name)
See HttpServletResponse.containsHeader(String). |
Response |
createEmbeddedResponse(String valueId,
String differentiator)
Creates a new Response instance that will be used for
embedded elements. |
void |
enableTextBuffer(boolean enabled)
Enables or disabled the text output buffer. |
String |
encodeURL(String url)
See HttpServletResponse.encodeURL(String). |
void |
flush()
Forces all the streamed content to be output to the client. |
String |
getCharacterEncoding()
See ServletResponse.getCharacterEncoding(). |
String |
getContentType()
Retrieves the content type that was explicitly set for this response. |
ArrayList<CharSequence> |
getEmbeddedContent()
Retrieves the content of the response for embedded usage and integration into another response. |
HttpServletResponse |
getHttpServletResponse()
Retrieves the underlying HttpServletResponse. |
Locale |
getLocale()
See ServletResponse.getLocale(). |
OutputStream |
getOutputStream()
See ServletResponse.getOutputStream(). |
PrintWriter |
getWriter()
See ServletResponse.getWriter(). |
boolean |
isContentTypeSet()
Indicates whether this response's content type has been explicitly set. |
boolean |
isEmbedded()
Indicates whether this response is embedded into another response. |
boolean |
isTextBufferEnabled()
Indicates whether the text output buffer is enabled. |
void |
print(Collection<CharSequence> deferredContent)
Prints a list of text snippets to the request text output. |
void |
print(Object value)
Prints the string representation of an object to the request text output. |
void |
print(Template template)
Prints the content of a template to the request text output. |
void |
sendError(int statusCode)
See HttpServletResponse.sendError(int). |
void |
sendError(int statusCode,
String message)
See HttpServletResponse.sendError(int, String). |
void |
sendRedirect(String location)
See HttpServletResponse.sendRedirect(String). |
void |
setContentLength(int length)
See ServletResponse.setContentLength(int). |
void |
setContentType(String contentType)
See ServletResponse.setContentType(String). |
void |
setDateHeader(String name,
long date)
See HttpServletResponse.setDateHeader(String, long). |
void |
setHeader(String name,
String value)
See HttpServletResponse.setHeader(String, String). |
void |
setIntHeader(String name,
int value)
See HttpServletResponse.setIntHeader(String, int). |
void |
setLastElement(ElementSupport element)
Sets the latest target element of this response. |
void |
setLocale(Locale locale)
See ServletResponse.setLocale(Locale). |
void |
setStatus(int statusCode)
See HttpServletResponse.setStatus(int). |
| Method Detail |
|---|
Response createEmbeddedResponse(String valueId,
String differentiator)
Response instance that will be used for
embedded elements.
valueId - the template value in which the embedded element will
be processeddifferentiator - the embedded element differentiator
Response instance for embedded useArrayList<CharSequence> getEmbeddedContent()
null if the response is not embedded.
boolean isEmbedded()
true if the response is embedded; or
false otherwise.
void setLastElement(ElementSupport element)
element - an element that has been executed in the context of this
responsevoid enableTextBuffer(boolean enabled)
The buffer is enabled by default and its buffered contents will be flushed when the buffer is disabled.
enabled - true to enable the text buffer; or
false to disable it
boolean isTextBufferEnabled()
true when the text buffer is enabled; or
false when it is disabled.
void print(Template template)
throws EngineException
template - the template that will be printed
EngineException - if an error
occurs during the output of the template contentprint(Collection),
print(Object)
void print(Collection<CharSequence> deferredContent)
throws EngineException
deferredContent - the text snippets that will be printed
EngineException - if an error
occurs during the output of the text snippetsprint(Template),
print(Object)
void print(Object value)
throws EngineException
String.valueOf(value) call.
value - the object that will be output
EngineException - if an error
occurs during the output of the contentprint(Template),
print(Collection)void clearBuffer()
If the text buffer is disabled, this method does nothing.
void flush()
throws EngineException
If the text buffer is enabled, this will flush its content to the output stream first.
EngineException
void close()
throws EngineException
All content is flushed first.
EngineException
OutputStream getOutputStream()
throws EngineException
ServletResponse.getOutputStream().
EngineException
PrintWriter getWriter()
throws IOException
ServletResponse.getWriter().
IOExceptionvoid setContentType(String contentType)
ServletResponse.setContentType(String).
boolean isContentTypeSet()
true if it has been set; or
false otherwise
setContentType(java.lang.String)String getContentType()
null if the content type wasn't set
setContentType(java.lang.String)void setLocale(Locale locale)
ServletResponse.setLocale(Locale).
Locale getLocale()
ServletResponse.getLocale().
String getCharacterEncoding()
ServletResponse.getCharacterEncoding().
void setContentLength(int length)
throws EngineException
ServletResponse.setContentLength(int).
EngineExceptionvoid addCookie(Cookie cookie)
HttpServletResponse.addCookie(Cookie).
void addHeader(String name,
String value)
HttpServletResponse.addHeader(String, String).
void addDateHeader(String name,
long date)
HttpServletResponse.addDateHeader(String, long).
void addIntHeader(String name,
int integer)
HttpServletResponse.addIntHeader(String, int).
boolean containsHeader(String name)
HttpServletResponse.containsHeader(String).
void sendError(int statusCode)
throws EngineException
HttpServletResponse.sendError(int).
EngineException
void sendError(int statusCode,
String message)
throws EngineException
HttpServletResponse.sendError(int, String).
EngineException
void sendRedirect(String location)
throws EngineException
HttpServletResponse.sendRedirect(String).
EngineException
void setDateHeader(String name,
long date)
HttpServletResponse.setDateHeader(String, long).
void setHeader(String name,
String value)
HttpServletResponse.setHeader(String, String).
void setIntHeader(String name,
int value)
HttpServletResponse.setIntHeader(String, int).
void setStatus(int statusCode)
HttpServletResponse.setStatus(int).
String encodeURL(String url)
HttpServletResponse.encodeURL(String).
HttpServletResponse getHttpServletResponse()
HttpServletResponse.
HttpServletResponse instance; or
null if this response isn't backed by
HttpServletResponse
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||