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.
-
SC_ACCEPTED
-
-
SC_BAD_GATEWAY
-
-
SC_BAD_REQUEST
-
-
SC_CREATED
-
-
SC_FORBIDDEN
-
-
SC_INTERNAL_SERVER_ERROR
-
-
SC_MOVED_PERMANENTLY
-
-
SC_MOVED_TEMPORARILY
-
-
SC_NO_CONTENT
-
-
SC_NOT_FOUND
-
-
SC_NOT_IMPLEMENTED
-
-
SC_NOT_MODIFIED
-
-
SC_OK
-
-
SC_SERVICE_UNAVAILABLE
-
-
SC_UNAUTHORIZED
-
-
sendError(int)
- Sends an error response to the client using the specified status
code and no default message.
-
sendError(int, String)
- Sends an error response to the client using the specified status
code and detail message.
-
sendRedirect(String)
- Sends a redirect response to the client using the specified redirect
location URL.
-
setDateHeader(String, long)
- Sets the value of a date header field.
-
setHeader(String, String)
- Sets the value of a header field.
-
setIntHeader(String, int)
- Sets the value of an integer header field.
-
setStatus(int)
- Sets the status code and a default message for this response.
-
setStatus(int, String)
- Sets the status code and message for this response.
-
unsetHeader(String)
- Unsets the value of a header field.
SC_OK
public final static int SC_OK
SC_CREATED
public final static int SC_CREATED
SC_ACCEPTED
public final static int SC_ACCEPTED
SC_NO_CONTENT
public final static int SC_NO_CONTENT
SC_MOVED_PERMANENTLY
public final static int SC_MOVED_PERMANENTLY
SC_MOVED_TEMPORARILY
public final static int SC_MOVED_TEMPORARILY
SC_NOT_MODIFIED
public final static int SC_NOT_MODIFIED
SC_BAD_REQUEST
public final static int SC_BAD_REQUEST
SC_UNAUTHORIZED
public final static int SC_UNAUTHORIZED
SC_FORBIDDEN
public final static int SC_FORBIDDEN
SC_NOT_FOUND
public final static int SC_NOT_FOUND
SC_INTERNAL_SERVER_ERROR
public final static int SC_INTERNAL_SERVER_ERROR
SC_NOT_IMPLEMENTED
public final static int SC_NOT_IMPLEMENTED
SC_BAD_GATEWAY
public final static int SC_BAD_GATEWAY
SC_SERVICE_UNAVAILABLE
public final static int SC_SERVICE_UNAVAILABLE
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
setStatus
public abstract void setStatus(int sc)
- Sets the status code and a default message for this response.
- Parameters:
- sc - the status code
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
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
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
unsetHeader
public abstract void unsetHeader(String name)
- Unsets the value of a header field.
- Parameters:
- name - the header field name
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.
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.
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