public class HstServletResponseState extends Object implements HstResponseState
Modifier and Type | Field and Description |
---|---|
protected Map<String,List<String>> |
addedHeaders |
protected ByteArrayOutputStream |
byteOutputBuffer |
protected String |
characterEncoding |
protected org.hippoecm.hst.core.component.HstServletResponseState.CharArrayWriterBuffer |
charOutputBuffer |
protected boolean |
closed |
protected boolean |
committed |
protected int |
contentLength |
protected String |
contentType |
protected List<javax.servlet.http.Cookie> |
cookies |
protected Locale |
defaultLocale |
protected List<Comment> |
epilogueComments |
protected int |
errorCode |
protected String |
errorMessage |
protected boolean |
flushed |
protected boolean |
hasError |
protected boolean |
hasStatus |
protected List<KeyValue<String,Element>> |
headElements |
protected boolean |
isActionResponse |
protected boolean |
isMimeResponse |
protected boolean |
isRenderResponse |
protected boolean |
isResourceResponse |
protected boolean |
isStateAwareResponse |
protected Locale |
locale |
protected javax.servlet.ServletOutputStream |
outputStream |
protected javax.servlet.http.HttpServletResponse |
parentResponse |
protected List<Comment> |
preambleComments |
protected List<Element> |
preambleElements |
protected PrintWriter |
printWriter |
protected List<Element> |
processedElements |
protected javax.servlet.http.HttpServletRequest |
request |
protected boolean |
setContentTypeAfterEncoding |
protected Map<String,List<String>> |
setHeaders |
protected int |
statusCode |
protected HstComponentWindow |
window |
protected Element |
wrapperElement |
Constructor and Description |
---|
HstServletResponseState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse parentResponse,
HstComponentWindow window) |
Modifier and Type | Method and 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)
Preamble
Node s are written before the rest of the content of this HstResponseState . |
void |
addProcessedHeadElement(Element headElement) |
protected void |
addResponseCookie(javax.servlet.http.Cookie cookie) |
protected void |
addResponseHeader(String name,
String value) |
void |
clear() |
boolean |
containsHeadElement(String keyHint) |
boolean |
containsHeader(String name) |
Comment |
createComment(String comment) |
Element |
createElement(String tagName) |
protected void |
failIfCommitted() |
void |
flush() |
void |
flush(Writer writer) |
void |
flushBuffer() |
void |
forward(String pathInfo) |
protected List<String> |
getAddedHeaderList(String name,
boolean create) |
int |
getBufferSize() |
String |
getCharacterEncoding() |
String |
getContentType() |
int |
getErrorCode() |
String |
getErrorMessage() |
String |
getForwardPathInfo() |
List<Element> |
getHeadElements() |
Locale |
getLocale() |
javax.servlet.ServletOutputStream |
getOutputStream() |
protected Writer |
getParentWriter()
After invoking this method, the backing http servlet response becomes committed.
|
String |
getRedirectLocation() |
protected OutputStream |
getResponseOutputStream() |
protected PrintWriter |
getResponseWriter() |
protected List<String> |
getSetHeaderList(String name,
boolean create) |
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 |
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) |
protected void |
setResponseCharacterEncoding(String characterEncoding) |
protected void |
setResponseContentLength(int len) |
protected void |
setResponseContentType(String contentType) |
protected void |
setResponseHeader(String name,
String value) |
protected void |
setResponseLocale(Locale locale) |
protected void |
setResponseStatus(int status) |
void |
setStatus(int statusCode) |
void |
setStatus(int statusCode,
String message) |
void |
setWrapperElement(Element element) |
protected boolean isActionResponse
protected boolean isRenderResponse
protected boolean isResourceResponse
protected boolean isMimeResponse
protected boolean isStateAwareResponse
protected Locale defaultLocale
protected boolean flushed
protected ByteArrayOutputStream byteOutputBuffer
protected org.hippoecm.hst.core.component.HstServletResponseState.CharArrayWriterBuffer charOutputBuffer
protected javax.servlet.ServletOutputStream outputStream
protected PrintWriter printWriter
protected List<javax.servlet.http.Cookie> cookies
protected Element wrapperElement
protected boolean committed
protected boolean hasStatus
protected boolean hasError
protected Locale locale
protected boolean setContentTypeAfterEncoding
protected boolean closed
protected String characterEncoding
protected int contentLength
protected String contentType
protected int errorCode
protected String errorMessage
protected int statusCode
protected final javax.servlet.http.HttpServletRequest request
protected final javax.servlet.http.HttpServletResponse parentResponse
protected final HstComponentWindow window
public HstServletResponseState(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse parentResponse, HstComponentWindow window)
public Element createElement(String tagName)
createElement
in interface HstResponseState
protected void failIfCommitted()
public boolean isActionResponse()
isActionResponse
in interface HstResponseState
public boolean isRenderResponse()
isRenderResponse
in interface HstResponseState
public boolean isResourceResponse()
isResourceResponse
in interface HstResponseState
public boolean isMimeResponse()
isMimeResponse
in interface HstResponseState
public boolean isStateAwareResponse()
isStateAwareResponse
in interface HstResponseState
public void addCookie(javax.servlet.http.Cookie cookie)
addCookie
in interface HstResponseState
public void addDateHeader(String name, long date)
addDateHeader
in interface HstResponseState
public void addHeader(String name, String value)
addHeader
in interface HstResponseState
public void addIntHeader(String name, int value)
addIntHeader
in interface HstResponseState
public boolean containsHeader(String name)
containsHeader
in interface HstResponseState
public void sendError(int errorCode, String errorMessage) throws IOException
sendError
in interface HstResponseState
IOException
public void sendError(int errorCode) throws IOException
sendError
in interface HstResponseState
IOException
public int getErrorCode()
getErrorCode
in interface HstResponseState
public String getErrorMessage()
getErrorMessage
in interface HstResponseState
public void sendRedirect(String redirectLocation) throws IOException
sendRedirect
in interface HstResponseState
IOException
public String getRedirectLocation()
getRedirectLocation
in interface HstResponseState
public void forward(String pathInfo) throws IOException
forward
in interface HstResponseState
IOException
public String getForwardPathInfo()
getForwardPathInfo
in interface HstResponseState
public void setDateHeader(String name, long date)
setDateHeader
in interface HstResponseState
public void setHeader(String name, String value)
setHeader
in interface HstResponseState
public void setIntHeader(String name, int value)
setIntHeader
in interface HstResponseState
public void setStatus(int statusCode, String message)
setStatus
in interface HstResponseState
public void setStatus(int statusCode)
setStatus
in interface HstResponseState
public int getStatus()
getStatus
in interface HstResponseState
HstResponseState.setStatus(int)
and 0 if not setpublic void flushBuffer() throws IOException
flushBuffer
in interface HstResponseState
IOException
public int getBufferSize()
getBufferSize
in interface HstResponseState
public String getCharacterEncoding()
getCharacterEncoding
in interface HstResponseState
public String getContentType()
getContentType
in interface HstResponseState
public Locale getLocale()
getLocale
in interface HstResponseState
public javax.servlet.ServletOutputStream getOutputStream() throws IOException
getOutputStream
in interface HstResponseState
IOException
public PrintWriter getWriter() throws IOException
getWriter
in interface HstResponseState
IOException
public boolean isCommitted()
isCommitted
in interface HstResponseState
public void reset()
reset
in interface HstResponseState
public void resetBuffer()
resetBuffer
in interface HstResponseState
public void setBufferSize(int size)
setBufferSize
in interface HstResponseState
public void setCharacterEncoding(String charset)
setCharacterEncoding
in interface HstResponseState
public void setContentLength(int len)
setContentLength
in interface HstResponseState
public void setContentType(String type)
setContentType
in interface HstResponseState
public void setLocale(Locale locale)
setLocale
in interface HstResponseState
public void addHeadElement(Element element, String keyHint)
addHeadElement
in interface HstResponseState
public boolean containsHeadElement(String keyHint)
containsHeadElement
in interface HstResponseState
public void addProcessedHeadElement(Element headElement)
addProcessedHeadElement
in interface HstResponseState
public List<Element> getHeadElements()
getHeadElements
in interface HstResponseState
public void addPreambleNode(Comment comment)
addPreambleNode
in interface HstResponseState
public void addPreambleNode(Element element)
HstResponseState
Node
s are written before the rest of the content of this HstResponseState
. Note that
from this element
only the attributes and text of the element
are printed, and *not*
any descendant @link org.w3c.dom.Node}s of element
addPreambleNode
in interface HstResponseState
element
- the element that is a preamblepublic void addEpilogueNode(Comment comment)
addEpilogueNode
in interface HstResponseState
public void setWrapperElement(Element element)
setWrapperElement
in interface HstResponseState
public Element getWrapperElement()
getWrapperElement
in interface HstResponseState
public void clear()
clear
in interface HstResponseState
public void flush() throws IOException
flush
in interface HstResponseState
IOException
public void flush(Writer writer) throws IOException
flush
in interface HstResponseState
IOException
public boolean isFlushed()
isFlushed
in interface HstResponseState
public Comment createComment(String comment)
createComment
in interface HstResponseState
protected void setResponseLocale(Locale locale)
protected Writer getParentWriter() throws IOException
IOException
protected void addResponseCookie(javax.servlet.http.Cookie cookie)
protected void setResponseCharacterEncoding(String characterEncoding)
protected void setResponseContentType(String contentType)
protected void setResponseStatus(int status)
protected void setResponseContentLength(int len)
protected OutputStream getResponseOutputStream() throws IOException
IOException
protected PrintWriter getResponseWriter() throws IOException
IOException
Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.