001: /*
002: * Copyright 2003-2006 Rick Knowles <winstone-devel at lists sourceforge net>
003: * Distributed under the terms of either:
004: * - the common development and distribution license (CDDL), v1.0; or
005: * - the GNU Lesser General Public License, v2.1 or later
006: */
007: package javax.servlet.http;
008:
009: import java.io.IOException;
010:
011: /**
012: * Interface definition for http response objects.
013: *
014: * @author <a href="mailto:rick_knowles@hotmail.com">Rick Knowles</a>
015: */
016: public interface HttpServletResponse extends
017: javax.servlet.ServletResponse {
018: public static final int SC_ACCEPTED = 202;
019: public static final int SC_BAD_GATEWAY = 502;
020: public static final int SC_BAD_REQUEST = 400;
021: public static final int SC_CONFLICT = 409;
022: public static final int SC_CONTINUE = 100;
023: public static final int SC_CREATED = 201;
024: public static final int SC_EXPECTATION_FAILED = 417;
025: public static final int SC_FORBIDDEN = 403;
026: public static final int SC_FOUND = 302;
027: public static final int SC_GATEWAY_TIMEOUT = 504;
028: public static final int SC_GONE = 410;
029: public static final int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
030: public static final int SC_INTERNAL_SERVER_ERROR = 500;
031: public static final int SC_LENGTH_REQUIRED = 411;
032: public static final int SC_METHOD_NOT_ALLOWED = 405;
033: public static final int SC_MOVED_PERMANENTLY = 301;
034: public static final int SC_MOVED_TEMPORARILY = 302;
035: public static final int SC_MULTIPLE_CHOICES = 300;
036: public static final int SC_NO_CONTENT = 204;
037: public static final int SC_NON_AUTHORITATIVE_INFORMATION = 203;
038: public static final int SC_NOT_ACCEPTABLE = 406;
039: public static final int SC_NOT_FOUND = 404;
040: public static final int SC_NOT_IMPLEMENTED = 501;
041: public static final int SC_NOT_MODIFIED = 304;
042: public static final int SC_OK = 200;
043: public static final int SC_PARTIAL_CONTENT = 206;
044: public static final int SC_PAYMENT_REQUIRED = 402;
045: public static final int SC_PRECONDITION_FAILED = 412;
046: public static final int SC_PROXY_AUTHENTICATION_REQUIRED = 407;
047: public static final int SC_REQUEST_ENTITY_TOO_LARGE = 413;
048: public static final int SC_REQUEST_TIMEOUT = 408;
049: public static final int SC_REQUEST_URI_TOO_LONG = 414;
050: public static final int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
051: public static final int SC_RESET_CONTENT = 205;
052: public static final int SC_SEE_OTHER = 303;
053: public static final int SC_SERVICE_UNAVAILABLE = 503;
054: public static final int SC_SWITCHING_PROTOCOLS = 101;
055: public static final int SC_TEMPORARY_REDIRECT = 307;
056: public static final int SC_UNAUTHORIZED = 401;
057: public static final int SC_UNSUPPORTED_MEDIA_TYPE = 415;
058: public static final int SC_USE_PROXY = 305;
059:
060: public void addCookie(Cookie cookie);
061:
062: public void addDateHeader(String name, long date);
063:
064: public void addHeader(String name, String value);
065:
066: public void addIntHeader(String name, int value);
067:
068: public boolean containsHeader(String name);
069:
070: public String encodeRedirectURL(String url);
071:
072: public String encodeURL(String url);
073:
074: public void sendError(int sc) throws IOException;
075:
076: public void sendError(int sc, String msg) throws IOException;
077:
078: public void sendRedirect(String location) throws IOException;
079:
080: public void setDateHeader(String name, long date);
081:
082: public void setHeader(String name, String value);
083:
084: public void setIntHeader(String name, int value);
085:
086: public void setStatus(int sc);
087:
088: /**
089: * @deprecated As of version 2.1, due to ambiguous meaning of the message
090: * parameter. To set a status code use setStatus(int), to send
091: * an error with a description use sendError(int, String). Sets
092: * the status code and message for this response.
093: */
094: public void setStatus(int sc, String sm);
095:
096: /**
097: * @deprecated As of version 2.1, use encodeRedirectURL(String url) instead
098: */
099: public String encodeRedirectUrl(String url);
100:
101: /**
102: * @deprecated As of version 2.1, use encodeURL(String url) instead
103: */
104: public String encodeUrl(String url);
105: }
|