Creating servlets

You can use the servlet wizard to create Java™ servlets. The wizard walks you through the creation process and provides output files for use with your web application. The servlets can run on WebSphere® Application Server or other Java EE-compliant web servers.

Procedure

  1. In the Enterprise Explorer, expand your web project.
  2. Right-click the your project and select New > Servlet from the pop-up menu. The Create Servlet wizard appears.
  3. Follow the project wizard prompts.

What to do next

Modifiers
You can select a modifier in the wizard to specify whether your servlet class is public, abstract, or final. Classes cannot be both abstract and final.
javax.servlet.Servlet
Although javax.servlet.Servlet is provided as the default interface, you can use the wizard to add additional interfaces to implement.
Interface selection dialog
This dialog is displayed if you choose to add an interface to your servlet. As you type the name of the interface, a list of available interfaces is dynamically updated to display only the interfaces that match the pattern. Choose an interface to see the qualifier and then click OK.
Method stubs
You can select any appropriate method stubs to be created in the servlet file. The stubs that are created by using the Inherited abstract methods option must be implemented if you do not intend to create an abstract servlet. This action is not required for Constructors from superclass.
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: tcrtservlet.html