Package org.hippoecm.hst.core.component
Interface HstResponseState
-
public interface HstResponseState
Temporarily holds the current state of a HST response. Basically the response of each HstComponent is buffered and stored in a HstResponseState implementation. At the final stage, the HstComponent container will flush every buffered content by using this HstResponseState implementation. Therefore, this interface has all the similar methods which can be found in
to keep the contents buffered.HttpServletResponse
- Version:
- $Id$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addCookie(javax.servlet.http.Cookie cookie)
void
addDateHeader(String name, long date)
void
addEpilogueNode(Comment comment)
void
addHeadElement(Element element, String keyHint)
void
addHeader(String name, String value)
void
addIntHeader(String name, int value)
void
addPreambleNode(Comment comment)
void
addPreambleNode(Element element)
PreambleNode
s are written before the rest of the content of thisHstResponseState
.void
addProcessedHeadElement(Element headElement)
void
clear()
void
clearEpilogueComments()
clears the currently available epilogue nodes on theHstResponseState
void
clearPreambleComments()
clears the currently available preamble nodes on theHstResponseState
boolean
containsHeadElement(String keyHint)
boolean
containsHeader(String name)
Comment
createComment(String comment)
Element
createElement(String tagName)
void
flush()
* Flushes theHstResponseState
including the message body (response content)void
flush(boolean skipMessageBody)
Flushes theHstResponseState
but depending onskipMessageBody
skips writing the actual response message bodyvoid
flush(Writer writer)
Flushes theHstResponseState
towriter
including the message body (response content)void
flush(Writer writer, boolean skipMessageBody)
Flushes theHstResponseState
towriter
but depending onskipMessageBody
skips writing the actual response message bodyvoid
flushBuffer()
void
forward(String pathInfo)
int
getBufferSize()
String
getCharacterEncoding()
String
getContentType()
List<Node>
getEpilogueNodes()
Return unmodifiable epilogueNode
s.int
getErrorCode()
String
getErrorMessage()
String
getForwardPathInfo()
List<Element>
getHeadElements()
Locale
getLocale()
javax.servlet.ServletOutputStream
getOutputStream()
List<Node>
getPreambleNodes()
Return unmodifiable preambleNode
s.String
getRedirectLocation()
int
getStatus()
Element
getWrapperElement()
PrintWriter
getWriter()
boolean
isActionResponse()
boolean
isCommitted()
boolean
isFlushed()
boolean
isMimeResponse()
boolean
isRenderResponse()
boolean
isResourceResponse()
boolean
isStateAwareResponse()
void
reset()
void
resetBuffer()
void
sendError(int errorCode)
void
sendError(int errorCode, String errorMessage)
void
sendRedirect(String redirectLocation)
void
setBufferSize(int size)
void
setCharacterEncoding(String charset)
void
setContentLength(int len)
void
setContentLengthLong(long len)
void
setContentType(String type)
void
setDateHeader(String name, long date)
void
setHeader(String name, String value)
void
setIntHeader(String name, int value)
void
setLocale(Locale locale)
void
setStatus(int statusCode)
void
setStatus(int statusCode, String message)
void
setWrapperElement(Element element)
-
-
-
Method Detail
-
isActionResponse
boolean isActionResponse()
-
isRenderResponse
boolean isRenderResponse()
-
isResourceResponse
boolean isResourceResponse()
-
isMimeResponse
boolean isMimeResponse()
-
isStateAwareResponse
boolean isStateAwareResponse()
-
addCookie
void addCookie(javax.servlet.http.Cookie cookie)
-
addDateHeader
void addDateHeader(String name, long date)
-
addIntHeader
void addIntHeader(String name, int value)
-
containsHeader
boolean containsHeader(String name)
-
sendError
void sendError(int errorCode, String errorMessage) throws IOException
- Throws:
IOException
-
sendError
void sendError(int errorCode) throws IOException
- Throws:
IOException
-
getErrorCode
int getErrorCode()
-
getErrorMessage
String getErrorMessage()
-
sendRedirect
void sendRedirect(String redirectLocation) throws IOException
- Throws:
IOException
-
getRedirectLocation
String getRedirectLocation()
-
forward
void forward(String pathInfo) throws IOException
- Throws:
IOException
-
getForwardPathInfo
String getForwardPathInfo()
-
setDateHeader
void setDateHeader(String name, long date)
-
setIntHeader
void setIntHeader(String name, int value)
-
setStatus
void setStatus(int statusCode, String message)
-
setStatus
void setStatus(int statusCode)
-
getStatus
int getStatus()
- Returns:
- the status when set through
setStatus(int)
and 0 if not set
-
flushBuffer
void flushBuffer() throws IOException
- Throws:
IOException
-
getBufferSize
int getBufferSize()
-
getCharacterEncoding
String getCharacterEncoding()
-
getContentType
String getContentType()
-
getLocale
Locale getLocale()
-
getOutputStream
javax.servlet.ServletOutputStream getOutputStream() throws IOException
- Throws:
IOException
-
getWriter
PrintWriter getWriter() throws IOException
- Throws:
IOException
-
isCommitted
boolean isCommitted()
-
reset
void reset()
-
resetBuffer
void resetBuffer()
-
setBufferSize
void setBufferSize(int size)
-
setCharacterEncoding
void setCharacterEncoding(String charset)
-
setContentLength
void setContentLength(int len)
-
setContentLengthLong
void setContentLengthLong(long len)
-
setContentType
void setContentType(String type)
-
setLocale
void setLocale(Locale locale)
-
containsHeadElement
boolean containsHeadElement(String keyHint)
-
addProcessedHeadElement
void addProcessedHeadElement(Element headElement)
-
addPreambleNode
void addPreambleNode(Comment comment)
-
addPreambleNode
void addPreambleNode(Element element)
PreambleNode
s are written before the rest of the content of thisHstResponseState
. Note that from thiselement
only the attributes and text of theelement
are printed, and *not* any descendant @link org.w3c.dom.Node}s ofelement
- Parameters:
element
- the element that is a preamble
-
getPreambleNodes
List<Node> getPreambleNodes()
Return unmodifiable preambleNode
s.- Returns:
- unmodifiable preamble
Node
s
-
clearPreambleComments
void clearPreambleComments()
clears the currently available preamble nodes on theHstResponseState
-
addEpilogueNode
void addEpilogueNode(Comment comment)
-
getEpilogueNodes
List<Node> getEpilogueNodes()
Return unmodifiable epilogueNode
s.- Returns:
- unmodifiable epilogue
Node
s
-
clearEpilogueComments
void clearEpilogueComments()
clears the currently available epilogue nodes on theHstResponseState
-
setWrapperElement
void setWrapperElement(Element element)
-
getWrapperElement
Element getWrapperElement()
-
clear
void clear()
-
flush
void flush() throws IOException
* Flushes theHstResponseState
including the message body (response content)- Throws:
IOException
-
flush
void flush(Writer writer) throws IOException
Flushes theHstResponseState
towriter
including the message body (response content)- Parameters:
writer
-- Throws:
IOException
-
flush
void flush(boolean skipMessageBody) throws IOException
Flushes theHstResponseState
but depending onskipMessageBody
skips writing the actual response message body- Parameters:
skipMessageBody
-- Throws:
IOException
-
flush
void flush(Writer writer, boolean skipMessageBody) throws IOException
Flushes theHstResponseState
towriter
but depending onskipMessageBody
skips writing the actual response message body- Parameters:
writer
-skipMessageBody
-- Throws:
IOException
-
isFlushed
boolean isFlushed()
-
-