javax.servlet |
|
Java Source File Name | Type | Comment |
Filter.java | Interface | Filters the request or response to a servlet. |
FilterChain.java | Interface | Represents the next filter in a filter chain. |
FilterConfig.java | Interface | Configuration for a filter. |
GenericServlet.java | Class | GenericServlet is a convenient abstract class for defining Servlets. |
RequestDispatcher.java | Interface | The RequestDispatcher gives servlets the capabilities of SSI includes.
The forwarded or included page is handled as a normal page request.
RequestDispatcher disp;
disp = request.getRequestDispatcher("inc.jsp?a=b");
disp.include(request, response);
Servlets typically use ServletRequest.setAttribute()
to communicate between included pages.
A popular architecture uses servlets to process the initial request
and JSP files to format the results. |
Servlet.java | Interface | A servlet is any Java class with a null-arg constructor that
implements the Servlet API.
Simple servlets should extend HttpServlet to create servlets.
Servlets that need full control should extend GenericServlet.
Location
Servlets are usually loaded from WEB-INF/classes under the application's
root. |
ServletConfig.java | Interface | ServletConfig encapsulates servlet configuration and gives access to
the application (servlet context) object.
Servlet initialization parameters appear in the servlet configuration
file. |
ServletContext.java | Interface | ServletContexts encapsulate applications. |
ServletContextAttributeEvent.java | Class | The event class for changes to servlet context attributes. |
ServletContextAttributeListener.java | Interface | Interface for a listener receiving events when any of the ServletContext
attributes change. |
ServletContextEvent.java | Class | The event class for changes to the servlet context. |
ServletContextListener.java | Interface | Interface for a listener receiving events when the ServletContext
changes. |
ServletException.java | Class | A servlet exception. |
ServletInputStream.java | Class | Servlets generally read POSTed data with ServletInputStream. |
ServletOutputStream.java | Class | Servlets can use ServletOutputStream to write binary data to
the response. |
ServletRequest.java | Interface | ServletRequest encapsulates client request data. |
ServletRequestAttributeEvent.java | Class | The event class for changes to servlet request attributes. |
ServletRequestAttributeListener.java | Interface | Interface for a listener receiving events when any of the ServletRequest
attributes change. |
ServletRequestEvent.java | Class | The event class for changes to the servlet context. |
ServletRequestListener.java | Interface | Interface for a listener receiving events when the ServletRequest
changes. |
ServletRequestWrapper.java | Class | Wraps a servlet request in another request. |
ServletResponse.java | Interface | ServletReponse control the output to the client.
A typical servlet will output its response as follows:
response.setContentType("text/html; charset=UTF-8");
PrintWriter pw = response.getWriter();
pw.println("Hello, world");
Buffering
The servlet engine buffers output before sending it to the client.
Buffering adds efficiency and flexibility. |
ServletResponseWrapper.java | Class | Wraps a servlet response in another response. |
SingleThreadModel.java | Interface | Servlets implementing the SingleThreadModel have only a single thread
executing at any time. |
UnavailableException.java | Class | |