Package org.apache.catalina.core
Class ApplicationHttpResponse
- java.lang.Object
-
- jakarta.servlet.ServletResponseWrapper
-
- jakarta.servlet.http.HttpServletResponseWrapper
-
- org.apache.catalina.core.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 aninclude()
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)
DisallowaddCookie()
calls on an included response.void
addDateHeader(String name, long value)
DisallowaddDateHeader()
calls on an included response.void
addHeader(String name, String value)
DisallowaddHeader()
calls on an included response.void
addIntHeader(String name, int value)
DisallowaddIntHeader()
calls on an included response.String
getInfo()
Return descriptive information about this implementation.boolean
isIncluded()
Return the included flag for this response.void
reset()
Disallowreset()
calls on a included response.void
sendError(int sc)
DisallowsendError()
calls on an included response.void
sendError(int sc, String msg)
DisallowsendError()
calls on an included response.void
sendRedirect(String location)
DisallowsendRedirect()
calls on an included response.void
setBufferSize(int size)
IgnoresetBufferSize()
calls on an included response.void
setContentLength(int len)
DisallowsetContentLength()
calls on an included response.void
setContentType(String type)
DisallowsetContentType()
calls on an included response.void
setDateHeader(String name, long value)
DisallowsetDateHeader()
calls on an included response.void
setHeader(String name, String value)
DisallowsetHeader()
calls on an included response.void
setIntHeader(String name, int value)
DisallowsetIntHeader()
calls on an included response.void
setLocale(Locale loc)
DisallowsetLocale()
calls on an included response.void
setStatus(int sc)
DisallowsetStatus()
calls on an included response.void
setStatus(int sc, String msg)
DisallowsetStatus()
calls on an included response.-
Methods inherited from class jakarta.servlet.http.HttpServletResponseWrapper
containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, 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
-
-
-
-
Field Detail
-
included
protected boolean included
Is this wrapped response the subject of aninclude()
call?
-
info
protected static final String info
Descriptive information about this implementation.- See Also:
- Constant Field Values
-
-
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 wrappedincluded
-true
if this response is being processed by aRequestDispatcher.include()
call
-
-
Method Detail
-
reset
public void reset()
Disallowreset()
calls on a included response.- Specified by:
reset
in interfacejakarta.servlet.ServletResponse
- Overrides:
reset
in classjakarta.servlet.ServletResponseWrapper
- Throws:
IllegalStateException
- if the response has already been committed
-
setContentLength
public void setContentLength(int len)
DisallowsetContentLength()
calls on an included response.- Specified by:
setContentLength
in interfacejakarta.servlet.ServletResponse
- Overrides:
setContentLength
in classjakarta.servlet.ServletResponseWrapper
- Parameters:
len
- The new content length
-
setContentType
public void setContentType(String type)
DisallowsetContentType()
calls on an included response.- Specified by:
setContentType
in interfacejakarta.servlet.ServletResponse
- Overrides:
setContentType
in classjakarta.servlet.ServletResponseWrapper
- Parameters:
type
- The new content type
-
setLocale
public void setLocale(Locale loc)
DisallowsetLocale()
calls on an included response.- Specified by:
setLocale
in interfacejakarta.servlet.ServletResponse
- Overrides:
setLocale
in classjakarta.servlet.ServletResponseWrapper
- Parameters:
loc
- The new locale
-
setBufferSize
public void setBufferSize(int size)
IgnoresetBufferSize()
calls on an included response.- Specified by:
setBufferSize
in interfacejakarta.servlet.ServletResponse
- Overrides:
setBufferSize
in classjakarta.servlet.ServletResponseWrapper
- Parameters:
size
- The buffer size
-
addCookie
public void addCookie(jakarta.servlet.http.Cookie cookie)
DisallowaddCookie()
calls on an included response.- Specified by:
addCookie
in interfacejakarta.servlet.http.HttpServletResponse
- Overrides:
addCookie
in classjakarta.servlet.http.HttpServletResponseWrapper
- Parameters:
cookie
- The new cookie
-
addDateHeader
public void addDateHeader(String name, long value)
DisallowaddDateHeader()
calls on an included response.- Specified by:
addDateHeader
in interfacejakarta.servlet.http.HttpServletResponse
- Overrides:
addDateHeader
in classjakarta.servlet.http.HttpServletResponseWrapper
- Parameters:
name
- The new header namevalue
- The new header value
-
addHeader
public void addHeader(String name, String value)
DisallowaddHeader()
calls on an included response.- Specified by:
addHeader
in interfacejakarta.servlet.http.HttpServletResponse
- Overrides:
addHeader
in classjakarta.servlet.http.HttpServletResponseWrapper
- Parameters:
name
- The new header namevalue
- The new header value
-
addIntHeader
public void addIntHeader(String name, int value)
DisallowaddIntHeader()
calls on an included response.- Specified by:
addIntHeader
in interfacejakarta.servlet.http.HttpServletResponse
- Overrides:
addIntHeader
in classjakarta.servlet.http.HttpServletResponseWrapper
- Parameters:
name
- The new header namevalue
- The new header value
-
sendError
public void sendError(int sc) throws IOException
DisallowsendError()
calls on an included response.- Specified by:
sendError
in interfacejakarta.servlet.http.HttpServletResponse
- Overrides:
sendError
in classjakarta.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
DisallowsendError()
calls on an included response.- Specified by:
sendError
in interfacejakarta.servlet.http.HttpServletResponse
- Overrides:
sendError
in classjakarta.servlet.http.HttpServletResponseWrapper
- Parameters:
sc
- The new status codemsg
- The new message- Throws:
IOException
- if an input/output error occurs
-
sendRedirect
public void sendRedirect(String location) throws IOException
DisallowsendRedirect()
calls on an included response.- Specified by:
sendRedirect
in interfacejakarta.servlet.http.HttpServletResponse
- Overrides:
sendRedirect
in classjakarta.servlet.http.HttpServletResponseWrapper
- Parameters:
location
- The new location- Throws:
IOException
- if an input/output error occurs
-
setDateHeader
public void setDateHeader(String name, long value)
DisallowsetDateHeader()
calls on an included response.- Specified by:
setDateHeader
in interfacejakarta.servlet.http.HttpServletResponse
- Overrides:
setDateHeader
in classjakarta.servlet.http.HttpServletResponseWrapper
- Parameters:
name
- The new header namevalue
- The new header value
-
setHeader
public void setHeader(String name, String value)
DisallowsetHeader()
calls on an included response.- Specified by:
setHeader
in interfacejakarta.servlet.http.HttpServletResponse
- Overrides:
setHeader
in classjakarta.servlet.http.HttpServletResponseWrapper
- Parameters:
name
- The new header namevalue
- The new header value
-
setIntHeader
public void setIntHeader(String name, int value)
DisallowsetIntHeader()
calls on an included response.- Specified by:
setIntHeader
in interfacejakarta.servlet.http.HttpServletResponse
- Overrides:
setIntHeader
in classjakarta.servlet.http.HttpServletResponseWrapper
- Parameters:
name
- The new header namevalue
- The new header value
-
setStatus
public void setStatus(int sc)
DisallowsetStatus()
calls on an included response.- Specified by:
setStatus
in interfacejakarta.servlet.http.HttpServletResponse
- Overrides:
setStatus
in classjakarta.servlet.http.HttpServletResponseWrapper
- Parameters:
sc
- The new status code
-
setStatus
public void setStatus(int sc, String msg)
DisallowsetStatus()
calls on an included response.- Specified by:
setStatus
in interfacejakarta.servlet.http.HttpServletResponse
- Overrides:
setStatus
in classjakarta.servlet.http.HttpServletResponseWrapper
- Parameters:
sc
- The new status codemsg
- The new message
-
getInfo
public String getInfo()
Return descriptive information about this implementation.- Returns:
- descriptive information
-
isIncluded
public boolean isIncluded()
Return the included flag for this response.
-
-