Anyframe Web

anyframe.web.struts.action
Class DefaultDispatchActionSupport

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.springframework.web.struts.ActionSupport
          extended by anyframe.web.struts.action.AbstractActionSupport
              extended by anyframe.web.struts.action.DefaultDispatchActionSupport
Direct Known Subclasses:
AbstractDispatchAction

public class DefaultDispatchActionSupport
extends AbstractActionSupport

Public Dispatch Action Class which provide token, exception, error logging, pre/post execution features

We changed org.apache.struts.actions.DispatchAction Class into anyframe.web.struts.common.action.DefaultDispatchActionSupport Class in Anyframe.

Author:
modified by Byunghun Woo

Field Summary
protected  java.lang.Class clazz
          The Class instance of this DispatchAction class.
protected static org.apache.struts.util.MessageResources messages
          The message resources for this package.
protected  java.util.HashMap methods
          The set of Method objects we have introspected for this class, keyed by method name.
protected  java.lang.Class[] types
          The set of argument type classes for the reflected method call.
 
Fields inherited from class org.apache.struts.action.Action
servlet
 
Constructor Summary
DefaultDispatchActionSupport()
           
 
Method Summary
protected  org.apache.struts.action.ActionForward cancelled(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Method which is dispatched to when the request is a cancel button submit.
protected  org.apache.struts.action.ActionForward dispatchMethod(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String name)
          Dispatch to the specified method.
 org.apache.commons.logging.Log getLogger()
           Anyframe Core Delegation Util Method to get Logger
protected  java.lang.reflect.Method getMethod(java.lang.String name)
          Introspect the current class to identify a method of the specified name that accepts the same parameter types as the execute method does.
protected  java.lang.String getMethodName(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String parameter)
          Returns the method name, given a parameter's value.
protected  java.lang.Object getService(java.lang.String name)
          Returns with bean name the Bean registered with WebApplicationContext.
 org.apache.struts.action.ActionForward process(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process the specified HTTP request, and create the corresponding HTTP response (or forward to another web component that will create it).
protected  org.apache.struts.action.ActionForward unspecified(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Method which is dispatched to when there is no value for specified request parameter included in the request.
 
Methods inherited from class anyframe.web.struts.action.AbstractActionSupport
execute, postProcess, preProcess, processCheckedException, processFinally, processInvalidTokenException, processUnCheckedException
 
Methods inherited from class org.springframework.web.struts.ActionSupport
getMessageSourceAccessor, getServletContext, getTempDir, getWebApplicationContext, initWebApplicationContext, onDestroy, onInit, setServlet
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clazz

protected java.lang.Class clazz
The Class instance of this DispatchAction class.


messages

protected static org.apache.struts.util.MessageResources messages
The message resources for this package.


methods

protected java.util.HashMap methods
The set of Method objects we have introspected for this class, keyed by method name. This collection is populated as different methods are called, so that introspection needs to occur only once per method name.


types

protected java.lang.Class[] types
The set of argument type classes for the reflected method call. These are the same for all calls, so calculate them only once.

Constructor Detail

DefaultDispatchActionSupport

public DefaultDispatchActionSupport()
Method Detail

getLogger

public org.apache.commons.logging.Log getLogger()
                                         throws java.lang.Exception

Anyframe Core Delegation Util Method to get Logger

Overrides:
getLogger in class AbstractActionSupport
Throws:
java.lang.Exception

getService

protected java.lang.Object getService(java.lang.String name)
Returns with bean name the Bean registered with WebApplicationContext.

Overrides:
getService in class AbstractActionSupport
Parameters:
name - Bean name registered in ApplicationContext
Returns:
Object Returns the bean appropriate to the service.

process

public org.apache.struts.action.ActionForward process(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws java.lang.Exception
Process the specified HTTP request, and create the corresponding HTTP response (or forward to another web component that will create it). Return an ActionForward instance describing where and how control should be forwarded, or null if the response has already been completed.

Specified by:
process in class AbstractActionSupport
Parameters:
mapping - The ActionMapping used to select this instance
form - The optional ActionForm bean for this request (if any)
request - The HTTP request we are processing
response - The HTTP response we are creating
Returns:
The forward to which control should be transferred, or null if the response has been completed.
Throws:
java.lang.Exception - if an exception occurs

cancelled

protected org.apache.struts.action.ActionForward cancelled(org.apache.struts.action.ActionMapping mapping,
                                                           org.apache.struts.action.ActionForm form,
                                                           javax.servlet.http.HttpServletRequest request,
                                                           javax.servlet.http.HttpServletResponse response)
                                                    throws java.lang.Exception
Method which is dispatched to when the request is a cancel button submit. Subclasses of DispatchAction should override this method if they wish to provide default behavior different than returning null.

Throws:
java.lang.Exception
Since:
Struts 1.2.0

getMethodName

protected java.lang.String getMethodName(org.apache.struts.action.ActionMapping mapping,
                                         org.apache.struts.action.ActionForm form,
                                         javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpServletResponse response,
                                         java.lang.String parameter)
                                  throws java.lang.Exception
Returns the method name, given a parameter's value.

Parameters:
mapping - The ActionMapping used to select this instance
form - The optional ActionForm bean for this request (if any)
request - The HTTP request we are processing
response - The HTTP response we are creating
parameter - The ActionMapping parameter's name
Returns:
The method's name.
Throws:
java.lang.Exception
Since:
Struts 1.2.0

dispatchMethod

protected org.apache.struts.action.ActionForward dispatchMethod(org.apache.struts.action.ActionMapping mapping,
                                                                org.apache.struts.action.ActionForm form,
                                                                javax.servlet.http.HttpServletRequest request,
                                                                javax.servlet.http.HttpServletResponse response,
                                                                java.lang.String name)
                                                         throws java.lang.Exception
Dispatch to the specified method.

Throws:
java.lang.Exception
Since:
Struts 1.1

unspecified

protected org.apache.struts.action.ActionForward unspecified(org.apache.struts.action.ActionMapping mapping,
                                                             org.apache.struts.action.ActionForm form,
                                                             javax.servlet.http.HttpServletRequest request,
                                                             javax.servlet.http.HttpServletResponse response)
                                                      throws java.lang.Exception
Method which is dispatched to when there is no value for specified request parameter included in the request. Subclasses of DispatchAction should override this method if they wish to provide default behavior different than throwing a ServletException.

Throws:
java.lang.Exception

getMethod

protected java.lang.reflect.Method getMethod(java.lang.String name)
                                      throws java.lang.NoSuchMethodException
Introspect the current class to identify a method of the specified name that accepts the same parameter types as the execute method does.

Parameters:
name - Name of the method to be introspected
Throws:
java.lang.NoSuchMethodException - if no such method can be found

Anyframe Web

Copyright © 2008-2009 Samsung SDS. All Rights Reserved.