Class sun.server.http.HttpResponse
All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.http.HttpResponse
java.lang.Object
|
+----sun.server.http.HttpResponse
- public class HttpResponse
- extends Object
- implements HttpServletResponse
This class represents an HTTP response message.
-
getOutputStream()
- Returns the output stream for writing response data.
-
getStatusCode()
- Returns the status code for this response.
-
sendError(int)
- Writes an error response using the specified status code.
-
sendError(int, String)
- Writes an error response using the specified status code and detail
message.
-
sendRedirect(String)
- Sends a redirect response to the client using the specified redirect
location.
-
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)
- Sets the status code for this response with a default status message.
-
setStatus(int, String)
- Sets the status code and message for this response.
-
statusMsg(int)
- Returns a default status message for the specified status code.
-
unsetHeader(String)
- Unsets the value of a header field.
setStatus
public 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 void setStatus(int sc)
- Sets the status code for this response with a default status message.
- Parameters:
- sc - the status code
statusMsg
protected String statusMsg(int sc)
- Returns a default status message for the specified status code.
getStatusCode
public int getStatusCode()
- Returns the status code for this response.
setContentLength
public void setContentLength(int n)
- Sets the content length for this response.
setContentType
public void setContentType(String s)
- Sets the content type for this response.
setHeader
public 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 void setIntHeader(String name,
int value)
- Sets the value of an integer header field.
- Parameters:
- name - the header field name
- value - the header field value
setDateHeader
public void setDateHeader(String name,
long value)
- Sets the value of a date header field.
- Parameters:
- name - the header field name
- value - the header field value
unsetHeader
public void unsetHeader(String name)
- Unsets the value of a header field.
- Parameters:
- name - the header field name
getOutputStream
public ServletOutputStream getOutputStream()
- Returns the output stream for writing response data.
sendError
public void sendError(int sc) throws IOException
- Writes an error response using the specified status code. Since no detail
message is specified here, correspnding site-specific error html file
will be shipped if available.
- Parameters:
- sc - the status code
- Throws: IOException
- If an I/O error has occurred.
sendError
public void sendError(int sc,
String msg) throws IOException
- Writes an error response 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.
sendRedirect
public void sendRedirect(String location) throws IOException
- Sends a redirect response to the client using the specified redirect
location.
- Parameters:
- location - the redirect location URL
- Throws: IOException
- If an I/O error has occurred.
All Packages Class Hierarchy This Package Previous Next Index