Class HTTPServletWebDepictContext

All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, DepictContext, TextDepictContext, WebDepictContext, XHTMLDepictContext, XMLDepictContext

public class HTTPServletWebDepictContext extends AbstractWebDepictContext
A web depict context of an HTTP servlet.

The output stream defaults to text/plain encoded in UTF-8.

Author:
Garret Wilson
  • Constructor Details

    • HTTPServletWebDepictContext

      public HTTPServletWebDepictContext(HTTPServletGuiseRequest guiseRequest, javax.servlet.http.HttpServletResponse response, GuiseSession session, Destination destination) throws IOException
      Constructor.
      Parameters:
      guiseRequest - Guise request information.
      response - The HTTP servlet response.
      session - The Guise user session of which this context is a part.
      destination - The destination with which this context is associated.
      Throws:
      NullPointerException - if the given Guise request, session, and/or destination is null.
      IOException - If there was an I/O error loading a needed resource.
  • Method Details

    • getGuiseRequest

      protected HTTPServletGuiseRequest getGuiseRequest()
      Returns:
      The Guise HTTP request.
    • getResponse

      protected javax.servlet.http.HttpServletResponse getResponse()
      Returns:
      The HTTP servlet response.
    • getDepictionURI

      public URI getDepictionURI()
      Returns:
      The current full absolute URI for this depiction, including any query.
    • getAttributeHashAttributeQualifiedName

      protected com.globalmentor.xml.spec.NsQualifiedName getAttributeHashAttributeQualifiedName()
      Specified by:
      getAttributeHashAttributeQualifiedName in class AbstractXMLDepictContext
      Returns:
      The qualified name to use for the attribute hash attribute.
    • getContentHashAttributeQualifiedName

      protected com.globalmentor.xml.spec.NsQualifiedName getContentHashAttributeQualifiedName()
      Specified by:
      getContentHashAttributeQualifiedName in class AbstractXMLDepictContext
      Returns:
      The qualified name to use for the content hash attribute.
    • getOutputCharset

      public Charset getOutputCharset()
      Returns:
      The charset currently used for the text output.
    • getOutputContentType

      public com.globalmentor.net.MediaType getOutputContentType()
      Returns:
      The current content type of the text output.
    • setOutputContentType

      public void setOutputContentType(com.globalmentor.net.MediaType contentType)
      Sets the content type of the text output.

      This implementation removes all parameters and adds a character set parameter of the current encoding.

      Parameters:
      contentType - The content type of the text output.