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 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

      void addDateHeader(String name, long date)
    • addHeader

      void addHeader(String name, String value)
    • 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)
    • setHeader

      void setHeader(String name, String value)
    • 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

      jakarta.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)
    • createComment

      Comment createComment(String comment)
    • createElement

      Element createElement(String tagName)
    • addHeadElement

      void addHeadElement(Element element, String keyHint)
    • getHeadElements

      List<Element> getHeadElements()
    • containsHeadElement

      boolean containsHeadElement(String keyHint)
    • addProcessedHeadElement

      void addProcessedHeadElement(Element headElement)
    • addPreambleNode

      void addPreambleNode(Comment comment)
    • addPreambleNode

      void addPreambleNode(Element element)
      Preamble Nodes 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
      Parameters:
      element - the element that is a preamble
    • getPreambleNodes

      List<Node> getPreambleNodes()
      Return unmodifiable preamble Nodes.
      Returns:
      unmodifiable preamble Nodes
    • clearPreambleComments

      void clearPreambleComments()
      clears the currently available preamble nodes on the HstResponseState
    • addEpilogueNode

      void addEpilogueNode(Comment comment)
    • getEpilogueNodes

      List<Node> getEpilogueNodes()
      Return unmodifiable epilogue Nodes.
      Returns:
      unmodifiable epilogue Nodes
    • clearEpilogueComments

      void clearEpilogueComments()
      clears the currently available epilogue nodes on the HstResponseState
    • setWrapperElement

      void setWrapperElement(Element element)
    • getWrapperElement

      Element getWrapperElement()
    • clear

      void clear()
    • flush

      void flush() throws IOException
      * Flushes the HstResponseState including the message body (response content)
      Throws:
      IOException
    • flush

      void flush(Writer writer) throws IOException
      Flushes the HstResponseState to writer including the message body (response content)
      Parameters:
      writer -
      Throws:
      IOException
    • flush

      void flush(boolean skipMessageBody) throws IOException
      Flushes the HstResponseState but depending on skipMessageBody skips writing the actual response message body
      Parameters:
      skipMessageBody -
      Throws:
      IOException
    • flush

      void flush(Writer writer, boolean skipMessageBody) throws IOException
      Flushes the HstResponseState to writer but depending on skipMessageBody skips writing the actual response message body
      Parameters:
      writer -
      skipMessageBody -
      Throws:
      IOException
    • isFlushed

      boolean isFlushed()