public abstract class GenericServlet implements Servlet, ServletConfig, java.io.Serializable {
  // Constructors
  public GenericServlet();
  // Instance Methods
  public void destroy();
  public String getInitParameter(String name);
  public Enumeration getInitParameterNames();
  public ServletConfig getServletConfig();
  public ServletContext getServletContext();
  public String getServletInfo();
  public String getServletName();                            // New in 2.2
  public void init() throws ServletException;                // New in 2.1
  public void init(ServletConfig config) throws ServletException;
  public void log(String msg);
  public void log(String msg, Throwable t);                  // New in 2.1
  public abstract void service(ServletRequest req, ServletResponse res)    throws ServletException, IOException;
}
public interface RequestDispatcher {

// Methods
public abstract void forward(ServletRequest req, ServletResponse res)throws ServletException, java.io.IOException // New in 2.1
public abstract void include(ServletRequest req, ServletResponse res)throws ServletException, java.io.IOException // New in 2.1
}

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 interface ServletContext {
  // Methods
  public abstract Object getAttribute(String name);
  public abstract Enumeration getAttributeNames();           // New in 2.1
  public abstract ServletContext getContext(String uripath); // New in 2.1
  public abstract String getInitParameter(String name);      // New in 2.2
  public abstract Enumeration getInitParameterNames();       // New in 2.2
  public abstract int getMajorVersion();                     // New in 2.1
  public abstract String getMimeType(String file);
  public abstract int getMinorVersion();                     // New in 2.1
  public abstract RequestDispatcher getNamedDispatcher(String name);       // New in 2.2
  public abstract String getRealPath(String path);
  public abstract URL getResource(String path)               // New in 2.1
   throws MalformedURLException;
  public abstract InputStream getResourceAsStream(String path); // New in 2.1
  public abstract String getServerInfo();
  public abstract Servlet getServlet(String name)            // Deprecated
    throws ServletException;
  public abstract Enumeration getServletNames();             // Deprecated
  public abstract Enumeration getServlets();                 // Deprecated
  public abstract void log(Exception exception, String msg); // Deprecated
  public abstract void log(String msg);
  public abstract void log(String msg, Throwable t);         // New in 2.1
  public abstract void removeAttribute(String name);         // New in 2.1
  public abstract void setAttribute(String name, Object o);  // New in 2.1
}
 
 

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 abstract class ServletInputStream extends java.io.InputStream {
  // Constructors
  protected ServletInputStream();
  // Instance methods
  public int readLine(byte b[], int off, int len) throws IOException;
}
public abstract class ServletOutputStream extends java.io.OutputStream {

  // Constructors
  protected ServletOutputStream();
  // Instance methods
  public void print(boolean b) throws IOException;
  public void print(char c) throws IOException;
  public void print(double d) throws IOException;
  public void print(float f) throws IOException;
  public void print(int i) throws IOException;
  public void print(long l) throws IOException;
  public void print(String s) throws IOException;
  public void println() throws IOException;
  public void println(boolean b) throws IOException;
  public void println(char c) throws IOException;
  public void println(double d) throws IOException;
  public void println(float f) throws IOException;
  public void println(int i) throws IOException;
  public void println(long l) throws IOException;
  public void println(String s) throws IOException;
}

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
}