package org.seasar.struts;

import javax.servlet.ServletException;

import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.RequestProcessor;
import org.apache.struts.config.ModuleConfig;

/**
 * @author Satoshi Kimura
 */
public class S2ActionServlet extends ActionServlet {

    /**
     * 
     */
    public S2ActionServlet() {
        super();
    }

    /**
     * <p>
     * Look up and return the {@link RequestProcessor}responsible for the specified module, creating a new one if
     * necessary.
     * </p>
     * 
     * @param config The module configuration for which to acquire and return a RequestProcessor.
     * @exception ServletException if we cannot instantiate a RequestProcessor instance
     */
    protected synchronized RequestProcessor getRequestProcessor(ModuleConfig config) throws ServletException {
        return RequestProcessorUtil.getRequestProcessor(config, getServletContext(), this);
    }
    
    /**
     * @see ActionServlet#init()
     * @see S2StrutsInitializer#registActionClass(ActionServlet)
     */
    public void init() throws ServletException {
        super.init();
        S2StrutsInitializer.registActionClass(this);
    }
}