/*
 * SingleMethodServlet.java
 *
 * Created on 9 de Março de 2001, 13:19
 */

package com.newtradebr.servlets;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.*;

/**
 * This class implements a Servlet that has the same response for both GET
 * and POST http methods. Subclasses must implement the <PRE>doWork()</PRE>
 * method that is called by the <PRE>doGet()</PRE> and <PRE>doPost()</PRE>
 * Servlet methods.
 *
 * @author Christian Rauh
 * @version 0.1
 */
public class SingleMethodServlet extends HttpServlet {
    
/**
 * Subclasses must implement this method with the behaviour that will be
 * executed when the Servlet receives either a GET or POST request. This
 * method is called by this classes <PRE>doGet()</PRE> and <PRE>doPost()</PRE>.
 */    
    public void doWork(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {
        super.doGet(request, response);
    }

/**
 * This method calls the <PRE>doWork()</PRE> method.
 */    
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {
        // Call the method that does the work.
        doWork(request, response);
    }
    
/**
 * This method calls the <PRE>doWork()</PRE> method.
 */    
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {
        // Call the method that does the work.
        doWork(request, response);
    }
}
