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
HttpServletResponse
to keep the contents buffered.- Version:
- $Id$
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCookie
(jakarta.servlet.http.Cookie cookie) void
addDateHeader
(String name, long date) void
addEpilogueNode
(Comment comment) void
addHeadElement
(Element element, String keyHint) void
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
clears the currently available epilogue nodes on theHstResponseState
void
clears the currently available preamble nodes on theHstResponseState
boolean
containsHeadElement
(String keyHint) boolean
containsHeader
(String name) createComment
(String comment) 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
Flushes theHstResponseState
towriter
including the message body (response content)void
Flushes theHstResponseState
towriter
but depending onskipMessageBody
skips writing the actual response message bodyvoid
void
int
Return unmodifiable epilogueNode
s.int
jakarta.servlet.ServletOutputStream
Return unmodifiable preambleNode
s.int
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
reset()
void
void
sendError
(int errorCode) void
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
void
setIntHeader
(String name, int value) void
void
setStatus
(int statusCode) void
void
setWrapperElement
(Element element)
-
Method Details
-
isActionResponse
boolean isActionResponse() -
isRenderResponse
boolean isRenderResponse() -
isResourceResponse
boolean isResourceResponse() -
isMimeResponse
boolean isMimeResponse() -
isStateAwareResponse
boolean isStateAwareResponse() -
addCookie
void addCookie(jakarta.servlet.http.Cookie cookie) -
addDateHeader
-
addHeader
-
addIntHeader
-
containsHeader
-
sendError
- Throws:
IOException
-
sendError
- Throws:
IOException
-
getErrorCode
int getErrorCode() -
getErrorMessage
String getErrorMessage() -
sendRedirect
- Throws:
IOException
-
getRedirectLocation
String getRedirectLocation() -
forward
- Throws:
IOException
-
getForwardPathInfo
String getForwardPathInfo() -
setDateHeader
-
setHeader
-
setIntHeader
-
setStatus
-
setStatus
void setStatus(int statusCode) -
getStatus
int getStatus()- Returns:
- the status when set through
setStatus(int)
and 0 if not set
-
flushBuffer
- Throws:
IOException
-
getBufferSize
int getBufferSize() -
getCharacterEncoding
String getCharacterEncoding() -
getContentType
String getContentType() -
getLocale
Locale getLocale() -
getOutputStream
- Throws:
IOException
-
getWriter
- Throws:
IOException
-
isCommitted
boolean isCommitted() -
reset
void reset() -
resetBuffer
void resetBuffer() -
setBufferSize
void setBufferSize(int size) -
setCharacterEncoding
-
setContentLength
void setContentLength(int len) -
setContentLengthLong
void setContentLengthLong(long len) -
setContentType
-
setLocale
-
createComment
-
createElement
-
addHeadElement
-
getHeadElements
-
containsHeadElement
-
addProcessedHeadElement
-
addPreambleNode
-
addPreambleNode
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
Return unmodifiable preambleNode
s.- Returns:
- unmodifiable preamble
Node
s
-
clearPreambleComments
void clearPreambleComments()clears the currently available preamble nodes on theHstResponseState
-
addEpilogueNode
-
getEpilogueNodes
Return unmodifiable epilogueNode
s.- Returns:
- unmodifiable epilogue
Node
s
-
clearEpilogueComments
void clearEpilogueComments()clears the currently available epilogue nodes on theHstResponseState
-
setWrapperElement
-
getWrapperElement
Element getWrapperElement() -
clear
void clear() -
flush
* Flushes theHstResponseState
including the message body (response content)- Throws:
IOException
-
flush
Flushes theHstResponseState
towriter
including the message body (response content)- Parameters:
writer
-- Throws:
IOException
-
flush
Flushes theHstResponseState
but depending onskipMessageBody
skips writing the actual response message body- Parameters:
skipMessageBody
-- Throws:
IOException
-
flush
Flushes theHstResponseState
towriter
but depending onskipMessageBody
skips writing the actual response message body- Parameters:
writer
-skipMessageBody
-- Throws:
IOException
-
isFlushed
boolean isFlushed()
-