|
STEP 6: Create and execute a
Basic Servlet
|
C:\Documents and Settings\ choose New -> All Templates
3. Accept the default setting, you may change the Class Name

4. Click Next and then Finish
5. Notice now the servlet is created.

6. Replace the default code after line package com.mycompany; with the following codes:
| import java.io.PrintWriter; import javax.servlet.*; public class NewServlet extends javax.servlet.http.HttpServlet { public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) performTask(request, response); } } } |
7. Compile and Execute it, you should see the Servlet working:
