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.
-
SC_ACCEPTED
-
-
SC_BAD_GATEWAY
-
-
SC_BAD_REQUEST
-
-
SC_CREATED
-
-
SC_FORBIDDEN
-
-
SC_INTERNAL_SERVER_ERROR
-
-
SC_MOVED_PERMANENTLY
-
-
SC_MOVED_TEMPORARILY
-
-
SC_NOT_FOUND
-
-
SC_NOT_IMPLEMENTED
-
-
SC_NOT_MODIFIED
-
-
SC_NO_CONTENT
-
-
SC_OK
-
-
SC_SERVICE_UNAVAILABLE
-
-
SC_UNAUTHORIZED
-
-
getOutputStream()
- Returns an output stream for writing response data.
-
sendError(int, String)
- Sends an error response to the client using the specified status
code and detail message.
-
sendError(int)
- Sends an error response to the client using the specified status
code and no default message.
-
sendRedirect(String)
- Sends a redirect response to the client using the specified redirect
location URL.
-
setContentLength(int)
- Sets the content length for this response.
-
setContentType(String)
- Sets the content type for this response.
-
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, String)
- Sets the status code and message for this response.
-
setStatus(int)
- Sets the status code and a default message for this response.
-
writeHeaders()
- Writes the status line and message headers for this response to
the output stream.
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
setContentLength
public abstract void setContentLength(int len)
- Sets the content length for this response.
- Parameters:
- len - the content length
setContentType
public abstract void setContentType(String type)
- Sets the content type for this response.
- Parameters:
- type - the content type
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
getOutputStream
public abstract ServletOutputStream getOutputStream()
- Returns an output stream for writing response data.
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.
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