Interface java.servlet.ServletResponse
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface java.servlet.ServletResponse

public interface ServletResponse
extends Object
This interface represents a servlet response.

Variable Index

 o SC_ACCEPTED
 o SC_BAD_GATEWAY
 o SC_BAD_REQUEST
 o SC_CREATED
 o SC_FORBIDDEN
 o SC_INTERNAL_SERVER_ERROR
 o SC_MOVED_PERMANENTLY
 o SC_MOVED_TEMPORARILY
 o SC_NOT_FOUND
 o SC_NOT_IMPLEMENTED
 o SC_NOT_MODIFIED
 o SC_NO_CONTENT
 o SC_OK
 o SC_SERVICE_UNAVAILABLE
 o SC_UNAUTHORIZED

Method Index

 o getOutputStream()
Returns an output stream for writing response data.
 o sendError(int, String)
Sends an error response to the client using the specified status code and detail message.
 o sendError(int)
Sends an error response to the client using the specified status code and no default message.
 o sendRedirect(String)
Sends a redirect response to the client using the specified redirect location URL.
 o setContentLength(int)
Sets the content length for this response.
 o setContentType(String)
Sets the content type for this response.
 o setDateHeader(String, long)
Sets the value of a date header field.
 o setHeader(String, String)
Sets the value of a header field.
 o setIntHeader(String, int)
Sets the value of an integer header field.
 o setStatus(int, String)
Sets the status code and message for this response.
 o setStatus(int)
Sets the status code and a default message for this response.
 o writeHeaders()
Writes the status line and message headers for this response to the output stream.

Variables

 o SC_OK
  public final static int SC_OK
 o SC_CREATED
  public final static int SC_CREATED
 o SC_ACCEPTED
  public final static int SC_ACCEPTED
 o SC_NO_CONTENT
  public final static int SC_NO_CONTENT
 o SC_MOVED_PERMANENTLY
  public final static int SC_MOVED_PERMANENTLY
 o SC_MOVED_TEMPORARILY
  public final static int SC_MOVED_TEMPORARILY
 o SC_NOT_MODIFIED
  public final static int SC_NOT_MODIFIED
 o SC_BAD_REQUEST
  public final static int SC_BAD_REQUEST
 o SC_UNAUTHORIZED
  public final static int SC_UNAUTHORIZED
 o SC_FORBIDDEN
  public final static int SC_FORBIDDEN
 o SC_NOT_FOUND
  public final static int SC_NOT_FOUND
 o SC_INTERNAL_SERVER_ERROR
  public final static int SC_INTERNAL_SERVER_ERROR
 o SC_NOT_IMPLEMENTED
  public final static int SC_NOT_IMPLEMENTED
 o SC_BAD_GATEWAY
  public final static int SC_BAD_GATEWAY
 o SC_SERVICE_UNAVAILABLE
  public final static int SC_SERVICE_UNAVAILABLE

Methods

 o setStatus
  public abstract void setStatus(int sc,
                                 String sm)
Sets the status code and message for this response.
Parameters:
sc - the status code
sm - the status message
 o setStatus
  public abstract void setStatus(int sc)
Sets the status code and a default message for this response.
Parameters:
sc - the status code
 o setContentLength
  public abstract void setContentLength(int len)
Sets the content length for this response.
Parameters:
len - the content length
 o setContentType
  public abstract void setContentType(String type)
Sets the content type for this response.
Parameters:
type - the content type
 o setHeader
  public abstract void setHeader(String name,
                                 String value)
Sets the value of a header field.
Parameters:
name - the header field name
value - the header field value
 o setIntHeader
  public abstract void setIntHeader(String name,
                                    int value)
Sets the value of an integer header field.
Parameters:
name - the header field name
value - the header field integer value
 o setDateHeader
  public abstract void setDateHeader(String name,
                                     long date)
Sets the value of a date header field.
Parameters:
name - the header field name
value - the header field date value
 o getOutputStream
  public abstract ServletOutputStream getOutputStream()
Returns an output stream for writing response data.
 o writeHeaders
  public abstract void writeHeaders() throws IOException
Writes the status line and message headers for this response to the output stream.
Throws: IOException
If an I/O error has occurred.
 o sendError
  public abstract void sendError(int sc,
                                 String msg) throws IOException
Sends an error response to the client using the specified status code and detail message.
Parameters:
sc - the status code
msg - the detail message
Throws: IOException
If an I/O error has occurred.
 o sendError
  public abstract void sendError(int sc) throws IOException
Sends an error response to the client using the specified status code and no default message.
Parameters:
sc - the status code
Throws: IOException
If an I/O error has occurred.
 o sendRedirect
  public abstract void sendRedirect(String location) throws IOException
Sends a redirect response to the client using the specified redirect location URL.
Parameters:
location - the redirect location URL
Throws: IOException
If an I/O error has occurred.

All Packages  Class Hierarchy  This Package  Previous  Next  Index