Write a servlet
This section shows you step-by-step how to write a sample servlet called ServletSample. Each step is included with reference information about servlet methods and syntax and a description of how each piece of code works.

To write the ServletSample servlet, perform these steps:

  1. Open your programming editor to edit a new file to be called ServletSample.java. For more information, see the WebSphere Development Studio Client Help.

  2. Enter the servlet import statements.

  3. Extend the HTTPServlet class.

  4. Write the required servlet methods.

  5. Get the HTTP request information, if any.

  6. Create the HTTP response.