com.scooterframework.web.controller
Class MainActionServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.scooterframework.web.controller.MainActionServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class MainActionServlet
extends javax.servlet.http.HttpServlet

MainActionServlet class

See Also:
Serialized Form

Field Summary
static java.lang.String KEY_ACTION_SERVLET
          The key for this servlet in servlet context.
static java.lang.String KEY_REQUEST_PROCESSOR
          The key for this request processor in servlet context.
 
Constructor Summary
MainActionServlet()
           
 
Method Summary
 void destroy()
          Shuts down this servlet
 void doDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes an http request with "DELETE" method.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes an http request with "GET" method.
 void doHead(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes an http request with "HEAD" method.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes an http request with "POST" method.
 void doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes an http request with "PUT" method.
 void init()
          Initializes this servlet
protected  void initOtherParameters()
          Initializes other global characteristics of the controller servlet.
static boolean isUsingRestfulProcessor()
          Checks if com.scooterframework.web.controller.RestfulRequestProcessor is used.
protected  void process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes request.
 void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes an http request.
 
Methods inherited from class javax.servlet.http.HttpServlet
doOptions, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_ACTION_SERVLET

public static final java.lang.String KEY_ACTION_SERVLET
The key for this servlet in servlet context.

See Also:
Constant Field Values

KEY_REQUEST_PROCESSOR

public static final java.lang.String KEY_REQUEST_PROCESSOR
The key for this request processor in servlet context.

See Also:
Constant Field Values
Constructor Detail

MainActionServlet

public MainActionServlet()
Method Detail

isUsingRestfulProcessor

public static boolean isUsingRestfulProcessor()
Checks if com.scooterframework.web.controller.RestfulRequestProcessor is used.

Returns:
trur if used.

destroy

public void destroy()
Shuts down this servlet

Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet

init

public void init()
          throws javax.servlet.ServletException
Initializes this servlet

Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

doHead

public void doHead(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException,
                   javax.servlet.ServletException
Processes an http request with "HEAD" method.

Overrides:
doHead in class javax.servlet.http.HttpServlet
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Processes an http request with "GET" method.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException,
                   javax.servlet.ServletException
Processes an http request with "POST" method.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

doPut

public void doPut(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Processes an http request with "PUT" method.

Overrides:
doPut in class javax.servlet.http.HttpServlet
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

doDelete

public void doDelete(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws java.io.IOException,
                     javax.servlet.ServletException
Processes an http request with "DELETE" method.

Overrides:
doDelete in class javax.servlet.http.HttpServlet
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

service

public void service(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response)
             throws java.io.IOException,
                    javax.servlet.ServletException
Processes an http request.

Overrides:
service in class javax.servlet.http.HttpServlet
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

initOtherParameters

protected void initOtherParameters()
                            throws javax.servlet.ServletException
Initializes other global characteristics of the controller servlet.

Throws:
javax.servlet.ServletException - if we cannot initialize these resources

process

protected void process(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws java.io.IOException,
                       javax.servlet.ServletException
Processes request.

Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception is thrown