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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.