Top Fields Constructors Methods
javax.servlet.http

pack-priv Class NoBodyResponse

Located in compilation unit of javax.servlet.http.HttpServlet.

extends HttpServletResponseWrapper
Class Inheritance

Field Summary

Modifier and TypeField and Description
private boolean
private static final ResourceBundle
private NoBodyOutputStream
private boolean
private PrintWriter

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
addHeader(String
the name of the header
name
,
String
the additional header value If it contains octet string, it should be encoded according to RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)
value
)

Overrides javax.servlet.http.HttpServletResponseWrapper.addHeader.

Implements javax.servlet.http.HttpServletResponse.addHeader.

The default behavior of this method is to return addHeader(String name, String value) on the wrapped response object.
public void
addIntHeader(String
the name of the header
name
,
int
the assigned integer value
value
)

Overrides javax.servlet.http.HttpServletResponseWrapper.addIntHeader.

Implements javax.servlet.http.HttpServletResponse.addIntHeader.

The default behavior of this method is to call addIntHeader(String name, int value) on the wrapped response object.
private void
public ServletOutputStream
getOutputStream()

Overrides javax.servlet.ServletResponseWrapper.getOutputStream.

Implements javax.servlet.ServletResponse.getOutputStream.

Returns a ServletOutputStream suitable for writing binary data in the response.
public PrintWriter
getWriter()

Overrides javax.servlet.ServletResponseWrapper.getWriter.

Implements javax.servlet.ServletResponse.getWriter.

Returns a PrintWriter object that can send character text to the client.
pack-priv void
public void
setContentLength(int
an integer specifying the length of the content being returned to the client; sets the Content-Length header
len
)

Overrides javax.servlet.ServletResponseWrapper.setContentLength.

Implements javax.servlet.ServletResponse.setContentLength.

Sets the length of the content body in the response In HTTP servlets, this method sets the HTTP Content-Length header.
public void
setContentLengthLong(long
a long specifying the length of the content being returned to the client; sets the Content-Length header
len
)

Overrides javax.servlet.ServletResponseWrapper.setContentLengthLong.

Implements javax.servlet.ServletResponse.setContentLengthLong.

Sets the length of the content body in the response In HTTP servlets, this method sets the HTTP Content-Length header.
public void
setHeader(String
the name of the header
name
,
String
the header value If it contains octet string, it should be encoded according to RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)
value
)

Overrides javax.servlet.http.HttpServletResponseWrapper.setHeader.

Implements javax.servlet.http.HttpServletResponse.setHeader.

The default behavior of this method is to return setHeader(String name, String value) on the wrapped response object.
public void
setIntHeader(String
the name of the header
name
,
int
the assigned integer value
value
)

Overrides javax.servlet.http.HttpServletResponseWrapper.setIntHeader.

Implements javax.servlet.http.HttpServletResponse.setIntHeader.

The default behavior of this method is to call setIntHeader(String name, int value) on the wrapped response object.
Inherited from javax.servlet.http.HttpServletResponseWrapper:
addCookieaddDateHeadercontainsHeaderencodeRedirectURLencodeRedirectUrlencodeURLencodeUrlgetHeadergetHeaderNamesgetHeadersgetStatusgetTrailerFieldssendErrorsendErrorsendRedirectsetDateHeadersetStatussetStatussetTrailerFields

Field Detail

didSetContentLengthback to summary
private boolean didSetContentLength
lStringsback to summary
private static final ResourceBundle lStrings
noBodyback to summary
private NoBodyOutputStream noBody
usingOutputStreamback to summary
private boolean usingOutputStream
writerback to summary
private PrintWriter writer

Constructor Detail

NoBodyResponseback to summary
pack-priv NoBodyResponse(HttpServletResponse r)

Method Detail

addHeaderback to summary
public void addHeader(String name, String value)

Overrides javax.servlet.http.HttpServletResponseWrapper.addHeader.

Implements javax.servlet.http.HttpServletResponse.addHeader.

Doc from javax.servlet.http.HttpServletResponseWrapper.addHeader.

The default behavior of this method is to return addHeader(String name, String value) on the wrapped response object.

Parameters
name:String

Doc from javax.servlet.http.HttpServletResponse.addHeader.

the name of the header

value:String

Doc from javax.servlet.http.HttpServletResponse.addHeader.

the additional header value If it contains octet string, it should be encoded according to RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)

Annotations
@Override
addIntHeaderback to summary
public void addIntHeader(String name, int value)

Overrides javax.servlet.http.HttpServletResponseWrapper.addIntHeader.

Implements javax.servlet.http.HttpServletResponse.addIntHeader.

Doc from javax.servlet.http.HttpServletResponseWrapper.addIntHeader.

The default behavior of this method is to call addIntHeader(String name, int value) on the wrapped response object.

Parameters
name:String

Doc from javax.servlet.http.HttpServletResponse.addIntHeader.

the name of the header

value:int

Doc from javax.servlet.http.HttpServletResponse.addIntHeader.

the assigned integer value

Annotations
@Override
checkHeaderback to summary
private void checkHeader(String name)
getOutputStreamback to summary
public ServletOutputStream getOutputStream() throws IOException

Overrides javax.servlet.ServletResponseWrapper.getOutputStream.

Implements javax.servlet.ServletResponse.getOutputStream.

Doc from javax.servlet.ServletResponse.getOutputStream.

Returns a ServletOutputStream suitable for writing binary data in the response. The servlet container does not encode the binary data.

Calling flush() on the ServletOutputStream commits the response. Either this method or getWriter may be called to write the body, not both, except when reset has been called.

Returns:ServletOutputStream

a ServletOutputStream for writing binary data

Annotations
@Override
Exceptions
IOException:
if an input or output exception occurred
getWriterback to summary
public PrintWriter getWriter() throws UnsupportedEncodingException

Overrides javax.servlet.ServletResponseWrapper.getWriter.

Implements javax.servlet.ServletResponse.getWriter.

Doc from javax.servlet.ServletResponse.getWriter.

Returns a PrintWriter object that can send character text to the client. The PrintWriter uses the character encoding returned by getCharacterEncoding. If the response's character encoding has not been specified as described in getCharacterEncoding (i.e., the method just returns the default value ISO-8859-1), getWriter updates it to ISO-8859-1.

Calling flush() on the PrintWriter commits the response.

Either this method or getOutputStream may be called to write the body, not both, except when reset has been called.

Returns:PrintWriter

a PrintWriter object that can return character data to the client

Annotations
@Override
Exceptions
UnsupportedEncodingException:
if the character encoding returned by getCharacterEncoding cannot be used
setContentLengthback to summary
pack-priv void setContentLength()
setContentLengthback to summary
public void setContentLength(int len)

Overrides javax.servlet.ServletResponseWrapper.setContentLength.

Implements javax.servlet.ServletResponse.setContentLength.

Doc from javax.servlet.ServletResponse.setContentLength.

Sets the length of the content body in the response In HTTP servlets, this method sets the HTTP Content-Length header.

Parameters
len:int

an integer specifying the length of the content being returned to the client; sets the Content-Length header

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

Overrides javax.servlet.ServletResponseWrapper.setContentLengthLong.

Implements javax.servlet.ServletResponse.setContentLengthLong.

Doc from javax.servlet.ServletResponse.setContentLengthLong.

Sets the length of the content body in the response In HTTP servlets, this method sets the HTTP Content-Length header.

Parameters
len:long

a long specifying the length of the content being returned to the client; sets the Content-Length header

Annotations
@Override
setHeaderback to summary
public void setHeader(String name, String value)

Overrides javax.servlet.http.HttpServletResponseWrapper.setHeader.

Implements javax.servlet.http.HttpServletResponse.setHeader.

Doc from javax.servlet.http.HttpServletResponseWrapper.setHeader.

The default behavior of this method is to return setHeader(String name, String value) on the wrapped response object.

Parameters
name:String

Doc from javax.servlet.http.HttpServletResponse.setHeader.

the name of the header

value:String

Doc from javax.servlet.http.HttpServletResponse.setHeader.

the header value If it contains octet string, it should be encoded according to RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)

Annotations
@Override
setIntHeaderback to summary
public void setIntHeader(String name, int value)

Overrides javax.servlet.http.HttpServletResponseWrapper.setIntHeader.

Implements javax.servlet.http.HttpServletResponse.setIntHeader.

Doc from javax.servlet.http.HttpServletResponseWrapper.setIntHeader.

The default behavior of this method is to call setIntHeader(String name, int value) on the wrapped response object.

Parameters
name:String

Doc from javax.servlet.http.HttpServletResponse.setIntHeader.

the name of the header

value:int

Doc from javax.servlet.http.HttpServletResponse.setIntHeader.

the assigned integer value

Annotations
@Override