Class ApplicationHttpResponse

  • All Implemented Interfaces:
    jakarta.servlet.http.HttpServletResponse, jakarta.servlet.ServletResponse

    public class ApplicationHttpResponse
    extends jakarta.servlet.http.HttpServletResponseWrapper
    PWC 4858179 class ApplicationHttpResponse extends HttpServletResponseWrapper {
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean included
      Is this wrapped response the subject of an include() call?
      protected static String info
      Descriptive information about this implementation.
      • Fields inherited from interface jakarta.servlet.http.HttpServletResponse

        SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY
    • Constructor Summary

      Constructors 
      Constructor Description
      ApplicationHttpResponse​(jakarta.servlet.http.HttpServletResponse response)
      Construct a new wrapped response around the specified servlet response.
      ApplicationHttpResponse​(jakarta.servlet.http.HttpServletResponse response, boolean included)
      Construct a new wrapped response around the specified servlet response.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCookie​(jakarta.servlet.http.Cookie cookie)
      Disallow addCookie() calls on an included response.
      void addDateHeader​(String name, long value)
      Disallow addDateHeader() calls on an included response.
      void addHeader​(String name, String value)
      Disallow addHeader() calls on an included response.
      void addIntHeader​(String name, int value)
      Disallow addIntHeader() calls on an included response.
      String getInfo()
      Return descriptive information about this implementation.
      boolean isIncluded()
      Return the included flag for this response.
      void reset()
      Disallow reset() calls on a included response.
      void sendError​(int sc)
      Disallow sendError() calls on an included response.
      void sendError​(int sc, String msg)
      Disallow sendError() calls on an included response.
      void sendRedirect​(String location)
      Disallow sendRedirect() calls on an included response.
      void setBufferSize​(int size)
      Ignore setBufferSize() calls on an included response.
      void setContentLength​(int len)
      Disallow setContentLength() calls on an included response.
      void setContentType​(String type)
      Disallow setContentType() calls on an included response.
      void setDateHeader​(String name, long value)
      Disallow setDateHeader() calls on an included response.
      void setHeader​(String name, String value)
      Disallow setHeader() calls on an included response.
      void setIntHeader​(String name, int value)
      Disallow setIntHeader() calls on an included response.
      void setLocale​(Locale loc)
      Disallow setLocale() calls on an included response.
      void setStatus​(int sc)
      Disallow setStatus() calls on an included response.
      • Methods inherited from class jakarta.servlet.http.HttpServletResponseWrapper

        containsHeader, encodeRedirectURL, encodeURL, getHeader, getHeaderNames, getHeaders, getStatus, getTrailerFields, setTrailerFields
      • Methods inherited from class jakarta.servlet.ServletResponseWrapper

        flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getResponse, getWriter, isCommitted, isWrapperFor, isWrapperFor, resetBuffer, setCharacterEncoding, setContentLengthLong, setResponse
      • Methods inherited from interface jakarta.servlet.ServletResponse

        flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getWriter, isCommitted, resetBuffer, setCharacterEncoding, setContentLengthLong
    • Field Detail

      • included

        protected boolean included
        Is this wrapped response the subject of an include() call?
    • Constructor Detail

      • ApplicationHttpResponse

        public ApplicationHttpResponse​(jakarta.servlet.http.HttpServletResponse response)
        Construct a new wrapped response around the specified servlet response.
        Parameters:
        response - The servlet response being wrapped
      • ApplicationHttpResponse

        public ApplicationHttpResponse​(jakarta.servlet.http.HttpServletResponse response,
                                       boolean included)
        Construct a new wrapped response around the specified servlet response.
        Parameters:
        response - The servlet response being wrapped
        included - true if this response is being processed by a RequestDispatcher.include() call
    • Method Detail

      • reset

        public void reset()
        Disallow reset() calls on a included response.
        Specified by:
        reset in interface jakarta.servlet.ServletResponse
        Overrides:
        reset in class jakarta.servlet.ServletResponseWrapper
        Throws:
        IllegalStateException - if the response has already been committed
      • setContentLength

        public void setContentLength​(int len)
        Disallow setContentLength() calls on an included response.
        Specified by:
        setContentLength in interface jakarta.servlet.ServletResponse
        Overrides:
        setContentLength in class jakarta.servlet.ServletResponseWrapper
        Parameters:
        len - The new content length
      • setContentType

        public void setContentType​(String type)
        Disallow setContentType() calls on an included response.
        Specified by:
        setContentType in interface jakarta.servlet.ServletResponse
        Overrides:
        setContentType in class jakarta.servlet.ServletResponseWrapper
        Parameters:
        type - The new content type
      • setLocale

        public void setLocale​(Locale loc)
        Disallow setLocale() calls on an included response.
        Specified by:
        setLocale in interface jakarta.servlet.ServletResponse
        Overrides:
        setLocale in class jakarta.servlet.ServletResponseWrapper
        Parameters:
        loc - The new locale
      • setBufferSize

        public void setBufferSize​(int size)
        Ignore setBufferSize() calls on an included response.
        Specified by:
        setBufferSize in interface jakarta.servlet.ServletResponse
        Overrides:
        setBufferSize in class jakarta.servlet.ServletResponseWrapper
        Parameters:
        size - The buffer size
      • addCookie

        public void addCookie​(jakarta.servlet.http.Cookie cookie)
        Disallow addCookie() calls on an included response.
        Specified by:
        addCookie in interface jakarta.servlet.http.HttpServletResponse
        Overrides:
        addCookie in class jakarta.servlet.http.HttpServletResponseWrapper
        Parameters:
        cookie - The new cookie
      • addDateHeader

        public void addDateHeader​(String name,
                                  long value)
        Disallow addDateHeader() calls on an included response.
        Specified by:
        addDateHeader in interface jakarta.servlet.http.HttpServletResponse
        Overrides:
        addDateHeader in class jakarta.servlet.http.HttpServletResponseWrapper
        Parameters:
        name - The new header name
        value - The new header value
      • addHeader

        public void addHeader​(String name,
                              String value)
        Disallow addHeader() calls on an included response.
        Specified by:
        addHeader in interface jakarta.servlet.http.HttpServletResponse
        Overrides:
        addHeader in class jakarta.servlet.http.HttpServletResponseWrapper
        Parameters:
        name - The new header name
        value - The new header value
      • addIntHeader

        public void addIntHeader​(String name,
                                 int value)
        Disallow addIntHeader() calls on an included response.
        Specified by:
        addIntHeader in interface jakarta.servlet.http.HttpServletResponse
        Overrides:
        addIntHeader in class jakarta.servlet.http.HttpServletResponseWrapper
        Parameters:
        name - The new header name
        value - The new header value
      • sendError

        public void sendError​(int sc)
                       throws IOException
        Disallow sendError() calls on an included response.
        Specified by:
        sendError in interface jakarta.servlet.http.HttpServletResponse
        Overrides:
        sendError in class jakarta.servlet.http.HttpServletResponseWrapper
        Parameters:
        sc - The new status code
        Throws:
        IOException - if an input/output error occurs
      • sendError

        public void sendError​(int sc,
                              String msg)
                       throws IOException
        Disallow sendError() calls on an included response.
        Specified by:
        sendError in interface jakarta.servlet.http.HttpServletResponse
        Overrides:
        sendError in class jakarta.servlet.http.HttpServletResponseWrapper
        Parameters:
        sc - The new status code
        msg - The new message
        Throws:
        IOException - if an input/output error occurs
      • sendRedirect

        public void sendRedirect​(String location)
                          throws IOException
        Disallow sendRedirect() calls on an included response.
        Specified by:
        sendRedirect in interface jakarta.servlet.http.HttpServletResponse
        Overrides:
        sendRedirect in class jakarta.servlet.http.HttpServletResponseWrapper
        Parameters:
        location - The new location
        Throws:
        IOException - if an input/output error occurs
      • setDateHeader

        public void setDateHeader​(String name,
                                  long value)
        Disallow setDateHeader() calls on an included response.
        Specified by:
        setDateHeader in interface jakarta.servlet.http.HttpServletResponse
        Overrides:
        setDateHeader in class jakarta.servlet.http.HttpServletResponseWrapper
        Parameters:
        name - The new header name
        value - The new header value
      • setHeader

        public void setHeader​(String name,
                              String value)
        Disallow setHeader() calls on an included response.
        Specified by:
        setHeader in interface jakarta.servlet.http.HttpServletResponse
        Overrides:
        setHeader in class jakarta.servlet.http.HttpServletResponseWrapper
        Parameters:
        name - The new header name
        value - The new header value
      • setIntHeader

        public void setIntHeader​(String name,
                                 int value)
        Disallow setIntHeader() calls on an included response.
        Specified by:
        setIntHeader in interface jakarta.servlet.http.HttpServletResponse
        Overrides:
        setIntHeader in class jakarta.servlet.http.HttpServletResponseWrapper
        Parameters:
        name - The new header name
        value - The new header value
      • setStatus

        public void setStatus​(int sc)
        Disallow setStatus() calls on an included response.
        Specified by:
        setStatus in interface jakarta.servlet.http.HttpServletResponse
        Overrides:
        setStatus in class jakarta.servlet.http.HttpServletResponseWrapper
        Parameters:
        sc - The new status code
      • getInfo

        public String getInfo()
        Return descriptive information about this implementation.
        Returns:
        descriptive information
      • isIncluded

        public boolean isIncluded()
        Return the included flag for this response.