public abstract class HttpServlet extends
javax.servlet.GenericServlet
implements javax.servlet.Servlet, java.io.Serializable
{
// Constructors
public HttpServlet();
// Public instance method
public void service(ServletRequest req,
ServletResponse res)throws ServletException, IOException;
// Protected instance methods
protected void doDelete(HttpServletRequest
req, HttpServletResponse res)throws ServletException, IOException;
// New in 2.0
protected void doGet(HttpServletRequest
req, HttpServletResponse res)throws ServletException, IOException;
protected void doOptions(HttpServletRequest
req, HttpServletResponse res)throws ServletException, IOException;
// New in 2.0
protected void doPost(HttpServletRequest
req, HttpServletResponse res)throws ServletException, IOException;
protected void doPut(HttpServletRequest
req, HttpServletResponse res)throws ServletException, IOException;
// New in 2.0
protected void doTrace(HttpServletRequest
req, HttpServletResponse res)throws ServletException, IOException;
// New in 2.0
protected long getLastModified(HttpServletRequest
req);
protected void service(HttpServletRequest
req, HttpServletResponse res)throws ServletException, IOException;
}
public interface HttpServletRequest extends
javax.servlet.ServletRequest {
// Methods
public abstract String getAuthType();
public abstract String getContextPath();
// New in 2.2
public abstract Cookie[] getCookies();
// New in 2.0
public abstract long getDateHeader(String
name);
public abstract String getHeader(String
name);
public abstract Enumeration getHeaderNames();
public abstract Enumeration getHeaders(String
name); // New in 2.2
public abstract int getIntHeader(String
name);
public abstract String getMethod();
public abstract String getPathInfo();
public abstract String getPathTranslated();
public abstract String getQueryString();
public abstract String getRemoteUser();
public abstract String getRequestedSessionId();
// New in 2.0
public abstract String getRequestURI();
public abstract String getServletPath();
public abstract HttpSession getSession();
// New in 2.1
public abstract HttpSession getSession(boolean
create); // New in 2.0
public abstract java.security.Principal
getUserPrincipal(); // New in 2.2
public abstract boolean isRequestedSessionIdFromCookie();
// New in 2.0
public abstract boolean isRequestedSessionIdFromUrl();
// Deprecated
public abstract boolean isRequestedSessionIdFromURL();
// New in 2.1
public abstract boolean isRequestedSessionIdValid();
// New in 2.0
public abstract boolean isUserInRole(String
role); // New in 2.2
}
public interface HttpServletResponse extends
javax.servlet.ServletResponse {
// Constants
public static final int SC_ACCEPTED;
public static final int SC_BAD_GATEWAY;
public static final int SC_BAD_REQUEST;
public static final int SC_CONFLICT;
public static final int SC_CONTINUE;
// New in 2.0
public static final int SC_CREATED;
public static final int SC_EXPECTATION_FAILED;
// New in 2.2
public static final int SC_FORBIDDEN;
public static final int SC_GATEWAY_TIMEOUT;
// New in 2.0
public static final int SC_GONE;
// New in 2.0
public static final int SC_HTTP_VERSION_NOT_SUPPORTED;
// New in 2.0
public static final int SC_INTERNAL_SERVER_ERROR;
public static final int SC_LENGTH_REQUIRED;
// New in 2.0
public static final int SC_METHOD_NOT_ALLOWED;
// New in 2.0
public static final int SC_MOVED_PERMANENTLY;
public static final int SC_MOVED_TEMPORARILY;
public static final int SC_MULTIPLE_CHOICES;
// New in 2.0
public static final int SC_NO_CONTENT;
public static final int SC_NON_AUTHORITATIVE_INFORMATION;
// New in 2.0
public static final int SC_NOT_ACCEPTABLE;
// New in 2.0
public static final int SC_NOT_FOUND;
public static final int SC_NOT_IMPLEMENTED;
public static final int SC_NOT_MODIFIED;
public static final int SC_OK;
public static final int SC_PARTIAL_CONTENT;
// New in 2.0
public static final int SC_PAYMENT_REQUIRED;
// New in 2.0
public static final int SC_PRECONDITION_FAILED;
// New in 2.0
public static final int SC_PROXY_AUTHENTICATION_REQUIRED;
// New in 2.0
public static final int SC_REQUEST_ENTITY_TOO_LARGE;
// New in 2.0
public static final int SC_REQUEST_TIMEOUT;
// New in 2.0
public static final int SC_REQUEST_URI_TOO_LONG;
// New in 2.0
public static final int SC_REQUESTED_RANGE_NOT_SATISFIABLE;//
New in 2.2
public static final int SC_RESET_CONTENT;
// New in 2.0
public static final int SC_SEE_OTHER;
// New in 2.0
public static final int SC_SERVICE_UNAVAILABLE;
public static final int SC_SWITCHING_PROTOCOLS;
// New in 2.0
public static final int SC_UNAUTHORIZED;
public static final int SC_UNSUPPORTED_MEDIA_TYPE;
// New in 2.0
public static final int SC_USE_PROXY;
// New in 2.0
// Methods
public abstract void addCookie(Cookie
cookie);
// New in 2.0
public abstract void addDateHeader(String
name, long date);// New in 2.2
public abstract void addHeader(String
name, String value);// New in 2.2
public abstract void addIntHeader(String
name, int value);// New in 2.2
public abstract boolean containsHeader(String
name);
public abstract String encodeRedirectUrl(String
url); // Deprecated
public abstract String encodeRedirectURL(String
url); // New in 2.1
public abstract String encodeUrl(String
url);
// Deprecated
public abstract String encodeURL(String
url);
// New in 2.1
public abstract void sendError(int sc)throws
IOException, IllegalStateException;
public abstract void sendError(int sc,
String msg)throws IOException, IllegalStateException;
public abstract void sendRedirect(String
location)throws IOException, IllegalStateException;
public abstract void setDateHeader(String
name, long date);
public abstract void setHeader(String
name, String value);
public abstract void setIntHeader(String
name, int value);
public abstract void setStatus(int sc);
public abstract void setStatus(int sc,
String sm); // Deprecated
}
public interface HttpSession {
// Methods
// Most methods may throw IllegalStateException
public abstract Object getAttribute(String
name); // New in 2.2
public abstract Enumeration getAttributeNames();
// New in 2.2
public abstract long getCreationTime();
public abstract String getId();
public abstract long getLastAccessedTime();
public abstract int getMaxInactiveInterval();
// New in 2.1
public abstract HttpSessionContext getSessionContext();
// Deprecated
public abstract Object getValue(String
name);
// Deprecated
public abstract String[] getValueNames();
// Deprecated
public abstract void invalidate();
public abstract boolean isNew();
public abstract void putValue(String
name, Object value); // Deprecated
public abstract void removeAttribute(String
name); // New in 2.2
public abstract void removeValue(String
name);
// Deprecated
public abstract void setAttribute(String
name, Object value);// New in 2.2
public abstract void setMaxInactiveInterval(int
secs); // New in 2.1
}
public class HttpSessionBindingEvent extends
java.util.EventObject {
// Constructors
public HttpSessionBindingEvent(HttpSession
session, String name);
// Instance methods
public String getName();
public HttpSession getSession();
}
public interface HttpSessionBindingListener
extends java.util.EventListener {
// Methods
public abstract void valueBound(HttpSessionBindingEvent
event);
public abstract void valueUnbound(HttpSessionBindingEvent
event);
}
public interface HttpSessionContext {
// Methods
public abstract Enumeration getIds();
// Deprecated
public abstract HttpSession getSession(String
sessionId); // Deprecated
}
public class HttpUtils {
// Constructors
public HttpUtils();
// Class methods
public static StringBuffer getRequestURL(HttpServletRequest
req);
public static Hashtable parsePostData(int
len, ServletInputStream in);
public static Hashtable parseQueryString(String
s);
}