Class DummyResponse

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

    public class DummyResponse
    extends Object
    implements HttpResponse, jakarta.servlet.http.HttpServletResponse
    Dummy response object, used for JSP precompilation.
    Version:
    $Revision: 1.2 $ $Date: 2005/12/08 01:27:34 $
    Author:
    Remy Maucherat
    • Constructor Detail

      • DummyResponse

        public DummyResponse()
    • Method Detail

      • setAppCommitted

        public void setAppCommitted​(boolean appCommitted)
        Description copied from interface: Response
        Set the application commit flag.
        Specified by:
        setAppCommitted in interface Response
        Parameters:
        appCommitted - The new application committed flag value
      • isAppCommitted

        public boolean isAppCommitted()
        Description copied from interface: Response
        Application commit flag accessor.
        Specified by:
        isAppCommitted in interface Response
      • getConnector

        public Connector getConnector()
        Description copied from interface: Response
        Return the Connector through which this Response is returned.
        Specified by:
        getConnector in interface Response
      • setConnector

        public void setConnector​(Connector connector)
        Description copied from interface: Response
        Set the Connector through which this Response is returned.
        Specified by:
        setConnector in interface Response
        Parameters:
        connector - The new connector
      • getContentCount

        public int getContentCount()
        Description copied from interface: Response
        Return the number of bytes actually written to the output stream.
        Specified by:
        getContentCount in interface Response
      • getContext

        public Context getContext()
        Description copied from interface: Response
        Return the Context with which this Response is associated.
        Specified by:
        getContext in interface Response
      • setContext

        public void setContext​(Context context)
        Description copied from interface: Response
        Set the Context with which this Response is associated. This should be called as soon as the appropriate Context is identified.
        Specified by:
        setContext in interface Response
        Parameters:
        context - The associated Context
      • getIncluded

        public boolean getIncluded()
        Description copied from interface: Response
        Return the "processing inside an include" flag.
        Specified by:
        getIncluded in interface Response
      • setIncluded

        public void setIncluded​(boolean included)
        Description copied from interface: Response
        Set the "processing inside an include" flag.
        Specified by:
        setIncluded in interface Response
        Parameters:
        included - true if we are currently inside a RequestDispatcher.include(), else false
      • getInfo

        public String getInfo()
        Description copied from interface: Response
        Return descriptive information about this Response implementation and the corresponding version number, in the format <description>/<version>.
        Specified by:
        getInfo in interface Response
      • getRequest

        public Request getRequest()
        Description copied from interface: Response
        Return the Request with which this Response is associated.
        Specified by:
        getRequest in interface Response
      • setRequest

        public void setRequest​(Request request)
        Description copied from interface: Response
        Set the Request with which this Response is associated.
        Specified by:
        setRequest in interface Response
        Parameters:
        request - The new associated request
      • getResponse

        public jakarta.servlet.ServletResponse getResponse()
        Description copied from interface: Response
        Return the ServletResponse for which this object is the facade.
        Specified by:
        getResponse in interface Response
      • getStream

        public OutputStream getStream()
        Description copied from interface: Response
        Return the output stream associated with this Response.
        Specified by:
        getStream in interface Response
      • setStream

        public void setStream​(OutputStream stream)
        Description copied from interface: Response
        Set the output stream associated with this Response.
        Specified by:
        setStream in interface Response
        Parameters:
        stream - The new output stream
      • setSuspended

        public void setSuspended​(boolean suspended)
        Description copied from interface: Response
        Set the suspended flag.
        Specified by:
        setSuspended in interface Response
        Parameters:
        suspended - The new suspended flag value
      • isSuspended

        public boolean isSuspended()
        Description copied from interface: Response
        Suspended flag accessor.
        Specified by:
        isSuspended in interface Response
      • setError

        public void setError()
        Description copied from interface: Response
        Set the error flag.
        Specified by:
        setError in interface Response
      • isError

        public boolean isError()
        Description copied from interface: Response
        Error flag accessor.
        Specified by:
        isError in interface Response
      • createOutputStream

        public jakarta.servlet.ServletOutputStream createOutputStream()
                                                               throws IOException
        Description copied from interface: Response
        Create and return a ServletOutputStream to write the content associated with this Response.
        Specified by:
        createOutputStream in interface Response
        Throws:
        IOException - if an input/output error occurs
      • finishResponse

        public void finishResponse()
                            throws IOException
        Description copied from interface: Response
        Perform whatever actions are required to flush and close the output stream or writer, in a single operation.
        Specified by:
        finishResponse in interface Response
        Throws:
        IOException - if an input/output error occurs
      • getContentLength

        public int getContentLength()
        Description copied from interface: Response
        Return the content length that was set or calculated for this Response.
        Specified by:
        getContentLength in interface Response
      • getContentType

        public String getContentType()
        Description copied from interface: Response
        Return the content type that was set or calculated for this response, or null if no content type was set.
        Specified by:
        getContentType in interface Response
        Specified by:
        getContentType in interface jakarta.servlet.ServletResponse
      • getReporter

        public PrintWriter getReporter()
        Description copied from interface: Response
        Return a PrintWriter that can be used to render error messages, regardless of whether a stream or writer has already been acquired.
        Specified by:
        getReporter in interface Response
        Returns:
        Writer which can be used for error reports. If the response is not an error report returned using sendError or triggered by an unexpected exception thrown during the servlet processing (and only in that case), null will be returned if the response stream has already been used.
      • recycle

        public void recycle()
        Description copied from interface: Response
        Release all object references, and initialize instance variables, in preparation for reuse of this object.
        Specified by:
        recycle in interface Response
      • flushBuffer

        public void flushBuffer()
                         throws IOException
        Specified by:
        flushBuffer in interface jakarta.servlet.ServletResponse
        Throws:
        IOException
      • getBufferSize

        public int getBufferSize()
        Specified by:
        getBufferSize in interface jakarta.servlet.ServletResponse
      • getCharacterEncoding

        public String getCharacterEncoding()
        Specified by:
        getCharacterEncoding in interface jakarta.servlet.ServletResponse
      • setCharacterEncoding

        public void setCharacterEncoding​(String charEncoding)
        Specified by:
        setCharacterEncoding in interface jakarta.servlet.ServletResponse
      • getOutputStream

        public jakarta.servlet.ServletOutputStream getOutputStream()
                                                            throws IOException
        Specified by:
        getOutputStream in interface jakarta.servlet.ServletResponse
        Throws:
        IOException
      • getLocale

        public Locale getLocale()
        Specified by:
        getLocale in interface jakarta.servlet.ServletResponse
      • isCommitted

        public boolean isCommitted()
        Specified by:
        isCommitted in interface jakarta.servlet.ServletResponse
      • reset

        public void reset()
        Specified by:
        reset in interface jakarta.servlet.ServletResponse
      • resetBuffer

        public void resetBuffer()
        Description copied from interface: Response
        Reset the data buffer but not any status or header information.
        Specified by:
        resetBuffer in interface Response
        Specified by:
        resetBuffer in interface jakarta.servlet.ServletResponse
      • resetBuffer

        public void resetBuffer​(boolean resetWriterStreamFlags)
        Description copied from interface: Response
        Reset the data buffer and the using Writer/Stream flags but not any status or header information.
        Specified by:
        resetBuffer in interface Response
      • setBufferSize

        public void setBufferSize​(int size)
        Specified by:
        setBufferSize in interface jakarta.servlet.ServletResponse
      • setContentLength

        public void setContentLength​(int length)
        Specified by:
        setContentLength in interface jakarta.servlet.ServletResponse
      • setContentLengthLong

        public void setContentLengthLong​(long length)
        Specified by:
        setContentLengthLong in interface jakarta.servlet.ServletResponse
      • setContentType

        public void setContentType​(String type)
        Specified by:
        setContentType in interface jakarta.servlet.ServletResponse
      • setLocale

        public void setLocale​(Locale locale)
        Specified by:
        setLocale in interface jakarta.servlet.ServletResponse
      • getHeader

        public String getHeader​(String name)
        Description copied from interface: HttpResponse
        Return the value for the specified header, or null if this header has not been set. If more than one value was added for this name, only the first is returned; use HttpResponse.getHeaders(String) to retrieve all of them.
        Specified by:
        getHeader in interface HttpResponse
        Specified by:
        getHeader in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        name - Header name to look up
      • getHeaderNames

        public Collection<String> getHeaderNames()
        Specified by:
        getHeaderNames in interface HttpResponse
        Specified by:
        getHeaderNames in interface jakarta.servlet.http.HttpServletResponse
        Returns:
        a (possibly empty) Collection of the names of the headers of this response
      • getHeaders

        public Collection<String> getHeaders​(String name)
        Specified by:
        getHeaders in interface HttpResponse
        Specified by:
        getHeaders in interface jakarta.servlet.http.HttpServletResponse
        Parameters:
        name - the name of the response header whose values to return
        Returns:
        a (possibly empty) Collection of the values of the response header with the given name
      • addSessionCookieInternal

        public void addSessionCookieInternal​(jakarta.servlet.http.Cookie cookie)
        Description copied from interface: HttpResponse
        Special method for adding a session cookie as we should be overriding any previous
        Specified by:
        addSessionCookieInternal in interface HttpResponse
      • getMessage

        public String getMessage()
        Description copied from interface: HttpResponse
        Return the error message that was set with sendError() for this Response.
        Specified by:
        getMessage in interface HttpResponse
      • getStatus

        public int getStatus()
        Description copied from interface: HttpResponse
        Return the HTTP status code associated with this Response.
        Specified by:
        getStatus in interface HttpResponse
        Specified by:
        getStatus in interface jakarta.servlet.http.HttpServletResponse
      • reset

        public void reset​(int status,
                          String message)
        Description copied from interface: HttpResponse
        Reset this response, and specify the values for the HTTP status code and corresponding message.
        Specified by:
        reset in interface HttpResponse
      • addCookie

        public void addCookie​(jakarta.servlet.http.Cookie cookie)
        Specified by:
        addCookie in interface jakarta.servlet.http.HttpServletResponse
      • addDateHeader

        public void addDateHeader​(String name,
                                  long value)
        Specified by:
        addDateHeader in interface jakarta.servlet.http.HttpServletResponse
      • addHeader

        public void addHeader​(String name,
                              String value)
        Specified by:
        addHeader in interface jakarta.servlet.http.HttpServletResponse
      • addIntHeader

        public void addIntHeader​(String name,
                                 int value)
        Specified by:
        addIntHeader in interface jakarta.servlet.http.HttpServletResponse
      • containsHeader

        public boolean containsHeader​(String name)
        Specified by:
        containsHeader in interface jakarta.servlet.http.HttpServletResponse
      • encodeRedirectURL

        public String encodeRedirectURL​(String url)
        Specified by:
        encodeRedirectURL in interface jakarta.servlet.http.HttpServletResponse
      • encodeRedirectUrl

        public String encodeRedirectUrl​(String url)
      • encodeURL

        public String encodeURL​(String url)
        Specified by:
        encodeURL in interface jakarta.servlet.http.HttpServletResponse
      • encode

        public String encode​(String url)
        Description copied from interface: Response
        Apply URL Encoding to the given URL without adding session identifier et al associated to this response.
        Specified by:
        encode in interface Response
        Parameters:
        url - URL to be encoded
      • sendError

        public void sendError​(int status)
                       throws IOException
        Specified by:
        sendError in interface jakarta.servlet.http.HttpServletResponse
        Throws:
        IOException
      • sendError

        public void sendError​(int status,
                              String message)
                       throws IOException
        Specified by:
        sendError in interface jakarta.servlet.http.HttpServletResponse
        Throws:
        IOException
      • sendRedirect

        public void sendRedirect​(String location)
                          throws IOException
        Specified by:
        sendRedirect in interface jakarta.servlet.http.HttpServletResponse
        Throws:
        IOException
      • setDateHeader

        public void setDateHeader​(String name,
                                  long value)
        Specified by:
        setDateHeader in interface jakarta.servlet.http.HttpServletResponse
      • setHeader

        public void setHeader​(String name,
                              String value)
        Specified by:
        setHeader in interface jakarta.servlet.http.HttpServletResponse
      • setIntHeader

        public void setIntHeader​(String name,
                                 int value)
        Specified by:
        setIntHeader in interface jakarta.servlet.http.HttpServletResponse
      • setStatus

        public void setStatus​(int status)
        Specified by:
        setStatus in interface jakarta.servlet.http.HttpServletResponse
      • setStatus

        public void setStatus​(int status,
                              String message)
      • setDetailMessage

        public void setDetailMessage​(String msg)
        Description copied from interface: Response
        Sets detail error message.
        Specified by:
        setDetailMessage in interface Response
        Parameters:
        msg - detail error message
      • getDetailMessage

        public String getDetailMessage()
        Description copied from interface: Response
        Gets detail error message.
        Specified by:
        getDetailMessage in interface Response
        Returns:
        the detail error message