javax.servlet

Interface ServletResponse

Known Subinterfaces:
HttpServletResponse

public interface ServletResponse

A servlet can use this class to pass information to the client.
Since:
Servlet API 1.0

Method Summary

void
flushBuffer()
XXX
int
getBufferSize()
XXX
String
getCharacterEncoding()
Returns the characterset encoding in use by this Response
Locale
getLocale()
XXX
ServletOutputStream
getOutputStream()
Creates a ServletOutputStream for the servlet to write the data to.
PrintWriter
getWriter()
Creates a PrintWriter for the servlet to print text to.
boolean
isCommitted()
XXX
void
reset()
XXX
void
setBufferSize(int size)
XXX
void
setContentLength(int length)
Tells the client how many bytes to expect.
void
setContentType(String type)
Tells the client what mime type to expect
void
setLocale(Locale locale)
XXX

Method Details

flushBuffer

public void flushBuffer()
            throws IOException
XXX

getBufferSize

public int getBufferSize()
XXX

getCharacterEncoding

public String getCharacterEncoding()
Returns the characterset encoding in use by this Response
Returns:
the characterset encoding
Since:
Servlet API 2.0

getLocale

public Locale getLocale()
XXX

getOutputStream

public ServletOutputStream getOutputStream()
            throws IOException
Creates a ServletOutputStream for the servlet to write the data to. setContentLength and setContentType can only be called before anything is written to this stream. It is only possible to call getWriter or getOutputStream on a response, but not both.
Returns:
ServletOutputStream to write binary data
Since:
Servlet API 1.0

getWriter

public PrintWriter getWriter()
            throws IOException
Creates a PrintWriter for the servlet to print text to. The contenttype must be set before calling this method. It is only possible to call getWriter or getOutputStream on a response, but not both.
Returns:
the created PrintWriter
Since:
Servlet API 2.0

isCommitted

public boolean isCommitted()
XXX

reset

public void reset()
XXX

setBufferSize

public void setBufferSize(int size)
XXX

setContentLength

public void setContentLength(int length)
Tells the client how many bytes to expect.
Parameters:
length - the number of bytes in the reply
Since:
Servlet API 1.0

setContentType

public void setContentType(String type)
Tells the client what mime type to expect
Parameters:
type - the mime type of the content
Since:
Servlet API 1.0

setLocale

public void setLocale(Locale locale)
XXX