Using the Servlet API

The most common use of servlets is for handling HTTP requests in Web and application servers. Now we'll look at using the functions we discussed in the last section. We'll also build on the first servlet we created in the chapter.

HTTP Servlet Skeleton

Table 14.1 lists all the methods that are available in an HttpServlet interface for handling different types of requests. But the most used are the doPost() and the doGet() methods, which handle the servlet requests via the service method. Listing 14.4 shows a skeleton of a simple HTTP servlet that can handle both GET and POST requests. In the next section of the chapter, we develop a simple servlet based on this skeleton to convert a given string to its uppercase equivalent. ...

Get BEA WebLogic Server™ 8.1 Unleashed 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.