Top
Interstage Studio User's Guide
FUJITSU Software

2.3.2 Creating a Servlet

To create a servlet, use the Servlet wizard to create the servlet class source file and implement the required methods in the file. The method is described below.

Creating a New Servlet

From the [New] wizard, select [Web] > [Servlet], and the wizard creates the servlet. Refer to the following for the wizard settings:

When the wizard is executed, the servlet class Java source is generated and the required description is added to web.xml.

Editing the Servlet

After the source is generated, implement the doPost() and doGet() servlet methods. These methods usually implement processing in the following sequence:

  1. Get the parameter values from the request object.

  2. Set headers in the response object.

  3. Get the output stream from the response object and output response to the response object.

The way to implement these methods is the same as for an ordinary Java class. Use the Java editor to implement the methods.