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

Interface java.servlet.http.HttpServletResponse

public interface HttpServletResponse
extends Object
extends ServletResponse
This interface represents an HTTP servlet response. In the servlet's service method, cast the ServletResponse parameter to HttpServletResponse in order to set HTTP protocol specified header information for the 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_NO_CONTENT
 o SC_NOT_FOUND
 o SC_NOT_IMPLEMENTED
 o SC_NOT_MODIFIED
 o SC_OK
 o SC_SERVICE_UNAVAILABLE
 o SC_UNAUTHORIZED

Method Index

 o sendError(int)
Sends an error response to the client using the specified status code and no default message.
 o sendError(int, String)
Sends an error response to the client using the specified status code and detail message.
 o sendRedirect(String)
Sends a redirect response to the client using the specified redirect location URL.
 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)
Sets the status code and a default message for this response.
 o setStatus(int, String)
Sets the status code and message for this response.
 o unsetHeader(String)
Unsets the value of a header field.

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 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 unsetHeader
  public abstract void unsetHeader(String name)
Unsets the value of a header field.
Parameters:
name - the header field name
 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