5.4. Writing a simple servlet example

In this section, we describe a very simple servlet, the HelloWorldServlet. For a detailed discussion of servlets and how they function, please see Servlet and JSP Programming with IBM WebSphere Studio and VisualAge for Java, SG24-5755. We are more interested here in how to deploy a servlet under WebSphere V3.5. In 5.5, “Deploying the example servlet under WebSphere” on page 147, we explain how to deploy this servlet in WebSphere.

5.4.1. The HelloWorldServlet

Figure 53 shows the full HelloWorldServlet code:

Figure 53. The HelloWorldServlet
 import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorldServlet extends HttpServlet { protected void service(HttpServletRequest ...

Get WebSphere V3.5 Handbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.