public interface Servlet
{
// Methods
public abstract void destroy();
public abstract ServletConfig getServletConfig();
public abstract String getServletInfo();
public abstract void init(ServletConfig config)
throws ServletException;
public abstract void service(ServletRequest
req, ServletResponse res)
throws ServletException, IOException;
}
public interface ServletConfig {
// Methods
public abstract String getInitParameter(String name);
public abstract Enumeration getInitParameterNames();
public abstract ServletContext getServletContext();
public abstract String getServletName(); // New in 2.2
}
public class ServletException extends java.lang.Exception {
// Constructors
public ServletException();
// New in 2.0
public ServletException(String msg);
public ServletException(String msg, Throwable rootCause);
// New in 2.1
public ServletException(Throwable rootCause);
// New in 2.1
public Throwable getRootCause();
// New in 2.1
}
public interface ServletRequest {
// Methods
public abstract Object getAttribute(String name);
public abstract Enumeration getAttributeNames();
// New in 2.1
public abstract String getCharacterEncoding();
// New in 2.0
public abstract int getContentLength();
public abstract String getContentType();
public abstract ServletInputStream getInputStream() throws
IOException;
public abstract Locale getLocale();
// New in 2.2
public abstract Enumeration getLocales();
// New in 2.2
public abstract String getParameter(String name);
public abstract Enumeration getParameterNames();
public abstract String[] getParameterValues(String name);
public abstract String getProtocol();
public abstract BufferedReader getReader() throws IOException;//
New in 2.0
public abstract String getRealPath(String path);
// Deprecated
public abstract String getRemoteAddr();
public abstract String getRemoteHost();
public abstract RequestDispatcher getRequestDispatcher(String
path); // New
public abstract String getScheme();
public abstract String getServerName();
public abstract int getServerPort();
public abstract boolean isSecure();
// New in 2.2
public abstract void removeAttribute(String name);
// New in 2.2
public abstract void setAttribute(String name, Object o);
// New in 2.1
}
public class UnavailableException extends ServletException
{
// Constructors
public UnavailableException(int seconds, Servlet servlet, String
msg); // Deprecated
public UnavailableException(Servlet servlet, String msg);
// Deprecated
public UnavailableException(String msg);
// New in 2.2
public UnavailableException(String msg, int seconds);
// New in 2.2
// Instance methods
public Servlet getServlet();
// Deprecated
public int getUnavailableSeconds();
public boolean isPermanent();
}
public interface SingleThreadModel {
}
public interface ServletResponse {
// Methods
public abstract void flushBuffer() throws IOException;
// New in 2.2
public abstract int getBufferSize();
// New in 2.2
public abstract String getCharacterEncoding();
// New in 2.0
public abstract Locale getLocale();
// New in 2.2
public abstract ServletOutputStream getOutputStream() throws
IOException, IllegalStateException;
public abstract PrintWriter getWriter()throws IOException,
IllegalStateException;
// New in 2.0
public abstract boolean isCommitted();
// New in 2.2
public abstract void reset() throws IllegalStateException;
// New in 2.2
public abstract void setBufferSize(int size)throws IllegalStateException;
// New in 2.2
public abstract void setContentLength(int len);
public abstract void setContentType(String type);
public abstract void setLocale(Locale loc);
// New in 2.2
}