|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A servlet can use this class to pass information to the client.
Method Summary | |
java.lang.String |
getCharacterEncoding()
Returns the characterset encoding in use by this Response |
ServletOutputStream |
getOutputStream()
Creates a ServletOutputStream for the servlet to write the data to. |
java.io.PrintWriter |
getWriter()
Creates a PrintWriter for the servlet to print text to. |
void |
setContentLength(int length)
Tells the client how many bytes to expect. |
void |
setContentType(java.lang.String type)
Tells the client what mime type to expect |
Method Detail |
public void setContentLength(int length)
length
- the number of bytes in the replypublic void setContentType(java.lang.String type)
type
- the mime type of the contentpublic ServletOutputStream getOutputStream() throws java.io.IOException
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.getWriter
was already
called on this responsepublic java.io.PrintWriter getWriter() throws java.io.IOException
getWriter
or
getOutputStream
on a response, but not both.getOutputStream
was
already called on this responsepublic java.lang.String getCharacterEncoding()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |