Servlets
WAS allows you to deploy Java servlets. Servlets are Java programs that build dynamic client responses, such as Web pages. Servlets receive and respond to requests from Web clients, usually across HyperText Transfer Protocol (HTTP).
As long as servlets adhere to the Java Servlet API, they can be ported without modification to different operating systems or application servers. Servlets are more efficient than CGI programs because, unlike CGI programs, servlets are loaded into memory once, and each request is handled by a Java virtual machine thread, not an operating system process. Moreover, servlets are scalable, providing support for a multi-application server configuration. Servlets also allow you to cache data, access database information, and share data with other servlets, JSP files, and (in some environments) enterprise beans.
WAS supports the Java Servlet API 2.3. WAS also includes IBM extensions to the Java Servlet API.
See these topics for more information about developing servlets for WAS:
Application lifecycle listeners and events
This topic provides an overview of classes and interfaces you can use to monitor session contexts and session change.Servlet filtering
This topic describes how to filter HTTP responses by MIME-type and how to chain a series of servlets together.Page lists
The PageListServlet allows you to call a JSP file by name from within your servlet code. See this topic for more information.Automatic request and response encoding
WAS provides extensions that enable the application server to set encoding values and content type. See this topic for information about the autoRequestEncoding and autoResponseEncoding extensions.Enhanced error reporting
You can enhance error reporting in your Web application to provide more detailed and tailored messages to the client. See this topic for more information.Internal servlets
WAS ships with certain internal servlets that you can use in your Web modules. See this topic for a list of the servlets and their functions.