Top Description Fields Constructors Methods
org.apache.catalina.core

pack-priv Class ApplicationResponse

extends ServletResponseWrapper
Class Inheritance
Imports
java.util.Locale, jakarta.servlet.ServletResponse, .ServletResponseWrapper

Wrapper around a jakarta.servlet.ServletResponse that transforms an application response object (which might be the original one passed to a servlet, or might be based on the 2.3 jakarta.servlet.ServletResponseWrapper class) back into an internal org.apache.catalina.Response.

Warning

Due to Java's lack of support for multiple inheritance, all of the logic in ApplicationResponse is duplicated in ApplicationHttpResponse. Make sure that you keep these two classes in synchronization when making changes!

Author
Craig R. McClanahan

Field Summary

Modifier and TypeField and Description
protected boolean
included

Is this wrapped response the subject of an include() call?

Constructor Summary

AccessConstructor and Description
pack-priv
ApplicationResponse(ServletResponse
The servlet response being wrapped
response
,
boolean
true if this response is being processed by a RequestDispatcher.include() call
included
)

Construct a new wrapped response around the specified servlet response.

Method Summary

Modifier and TypeMethod and Description
public void
reset()

Overrides jakarta.servlet.ServletResponseWrapper.reset.

Implements jakarta.servlet.ServletResponse.reset.

Disallow reset() calls on a included response.

public void
setBufferSize(int
The buffer size
size
)

Overrides jakarta.servlet.ServletResponseWrapper.setBufferSize.

Implements jakarta.servlet.ServletResponse.setBufferSize.

Ignore setBufferSize() calls on an included response.

public void
setContentLength(int
The new content length
len
)

Overrides jakarta.servlet.ServletResponseWrapper.setContentLength.

Implements jakarta.servlet.ServletResponse.setContentLength.

Disallow setContentLength(int) calls on an included response.

public void
setContentLengthLong(long
The new content length
len
)

Overrides jakarta.servlet.ServletResponseWrapper.setContentLengthLong.

Implements jakarta.servlet.ServletResponse.setContentLengthLong.

Disallow setContentLengthLong(long) calls on an included response.

public void
setContentType(String
The new content type
type
)

Overrides jakarta.servlet.ServletResponseWrapper.setContentType.

Implements jakarta.servlet.ServletResponse.setContentType.

Disallow setContentType() calls on an included response.

pack-priv void
setIncluded(boolean
The new included flag
included
)

Set the included flag for this response.

public void
setLocale(Locale
The new locale
loc
)

Overrides jakarta.servlet.ServletResponseWrapper.setLocale.

Implements jakarta.servlet.ServletResponse.setLocale.

Ignore setLocale() calls on an included response.

public void
setResponse(ServletResponse
The new wrapped response
response
)

Overrides jakarta.servlet.ServletResponseWrapper.setResponse.

Set the response that we are wrapping.

Inherited from jakarta.servlet.ServletResponseWrapper:
flushBuffergetBufferSizegetCharacterEncodinggetContentTypegetLocalegetOutputStreamgetResponsegetWriterisCommittedisWrapperForisWrapperForresetBuffersetCharacterEncoding

Field Detail

includedback to summary
protected boolean included

Is this wrapped response the subject of an include() call?

Constructor Detail

ApplicationResponseback to summary
pack-priv ApplicationResponse(ServletResponse response, boolean included)

Construct a new wrapped response around the specified servlet response.

Parameters
response:ServletResponse

The servlet response being wrapped

included:boolean

true if this response is being processed by a RequestDispatcher.include() call

Method Detail

resetback to summary
public void reset()

Overrides jakarta.servlet.ServletResponseWrapper.reset.

Implements jakarta.servlet.ServletResponse.reset.

Disallow reset() calls on a included response.

Annotations
@Override
Exceptions
IllegalStateException:
if the response has already been committed
setBufferSizeback to summary
public void setBufferSize(int size)

Overrides jakarta.servlet.ServletResponseWrapper.setBufferSize.

Implements jakarta.servlet.ServletResponse.setBufferSize.

Ignore setBufferSize() calls on an included response.

Parameters
size:int

The buffer size

Annotations
@Override
setContentLengthback to summary
public void setContentLength(int len)

Overrides jakarta.servlet.ServletResponseWrapper.setContentLength.

Implements jakarta.servlet.ServletResponse.setContentLength.

Disallow setContentLength(int) calls on an included response.

Parameters
len:int

The new content length

Annotations
@Override
setContentLengthLongback to summary
public void setContentLengthLong(long len)

Overrides jakarta.servlet.ServletResponseWrapper.setContentLengthLong.

Implements jakarta.servlet.ServletResponse.setContentLengthLong.

Disallow setContentLengthLong(long) calls on an included response.

Parameters
len:long

The new content length

Annotations
@Override
setContentTypeback to summary
public void setContentType(String type)

Overrides jakarta.servlet.ServletResponseWrapper.setContentType.

Implements jakarta.servlet.ServletResponse.setContentType.

Disallow setContentType() calls on an included response.

Parameters
type:String

The new content type

Annotations
@Override
setIncludedback to summary
pack-priv void setIncluded(boolean included)

Set the included flag for this response.

Parameters
included:boolean

The new included flag

setLocaleback to summary
public void setLocale(Locale loc)

Overrides jakarta.servlet.ServletResponseWrapper.setLocale.

Implements jakarta.servlet.ServletResponse.setLocale.

Ignore setLocale() calls on an included response.

Parameters
loc:Locale

The new locale

Annotations
@Override
setResponseback to summary
public void setResponse(ServletResponse response)

Overrides jakarta.servlet.ServletResponseWrapper.setResponse.

Set the response that we are wrapping.

Parameters
response:ServletResponse

The new wrapped response

Annotations
@Override