Anyframe Web

anyframe.web.struts.action
Class AbstractDispatchAction

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
                  extended by anyframe.web.struts.action.AbstractDispatchAction

public abstract class AbstractDispatchAction
extends DefaultDispatchActionSupport

Class expanding the anyframe.web.struts.action.DefaultDispatchActionSupport.

Provides additional functionalities other than DefaultDispatchActionSupport functionalities.


The AbstractDispatchAction doesn't define the form in struts-config.xml the Struts's Form object. It allows for the usage of direct mapping in the server side value object user inputed value transmitted from the presentation layer.

We need to implement the getValueObject method and create the VO object for mapping in the inherited Action Class for the AbstractDispatchAction in order to map the value in the value object. The VO object implements the anyframe.common.ValueObject.

Author:
Byunghun Woo

Field Summary
 org.apache.commons.logging.Log log
           
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 anyframe.web.struts.action.DefaultDispatchActionSupport
clazz, messages
 
Fields inherited from class org.apache.struts.action.Action
servlet
 
Constructor Summary
AbstractDispatchAction()
           
 
Method Summary
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()
          get Logger
protected  java.lang.reflect.Method getMethod(java.lang.String name)
          get method
protected  java.lang.Object getService(java.lang.String name)
          Returns using the bean name for the bean registered in WebApplicationContext.
abstract  anyframe.common.ValueObject getValueObject()
          Returns by creating the instance of the VO class used on the Server side.
protected  void onInit()
           Anyframe Core Delegation Util Method to get Logger
 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)
          Overrides the process method of anyframe.web.struts.action.DefaultDispatchActionSupport.
protected  ValidatorError validate(javax.servlet.http.HttpServletRequest request, anyframe.common.ValueObject vo, java.lang.String validationKey)
          Does the VO's validation check.
protected  ValidatorError validate(javax.servlet.http.HttpServletRequest request, anyframe.common.ValueObject vo, java.lang.String validationKey, int page)
          Does the validation check of VO.
 
Methods inherited from class anyframe.web.struts.action.DefaultDispatchActionSupport
cancelled, getMethodName, unspecified
 
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, 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

log

public org.apache.commons.logging.Log log

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

AbstractDispatchAction

public AbstractDispatchAction()
Method Detail

onInit

protected void onInit()

Anyframe Core Delegation Util Method to get Logger

Overrides:
onInit in class org.springframework.web.struts.ActionSupport

getService

protected java.lang.Object getService(java.lang.String name)
Returns using the bean name for the bean registered in WebApplicationContext.

Overrides:
getService in class DefaultDispatchActionSupport
Parameters:
name - The bean name registered in ApplicationContext.
Returns:
Returns the bean appropriate to the Object 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
Overrides the process method of anyframe.web.struts.action.DefaultDispatchActionSupport.

If a specific request is requested, the process method is called with respect to the action mapping defined in the struts-config.xml. In the case the action class inheritting the AbstractionDispatchAction is defined as the mapping type, the process method is called and it again calls the appropriate method using the method's name info.

Overrides:
process in class DefaultDispatchActionSupport
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

getMethod

protected java.lang.reflect.Method getMethod(java.lang.String name)
                                      throws java.lang.NoSuchMethodException
get method

Overrides:
getMethod in class DefaultDispatchActionSupport
Parameters:
name - method name
Returns:
method
Throws:
java.lang.NoSuchMethodException - if no such method can be found

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.

Overrides:
dispatchMethod in class DefaultDispatchActionSupport
Throws:
java.lang.Exception
Since:
Struts 1.1

getLogger

public org.apache.commons.logging.Log getLogger()
get Logger

Overrides:
getLogger in class DefaultDispatchActionSupport

getValueObject

public abstract anyframe.common.ValueObject getValueObject()
Returns by creating the instance of the VO class used on the Server side. Has to be implemented in the action class inheritted from anyframe.web.struts.action.AbstractDispatchAction. Has to return by creating the VO's instance for mapping the user transmitted value.

Returns:
the VO for mapping the user transmitted value

validate

protected ValidatorError validate(javax.servlet.http.HttpServletRequest request,
                                  anyframe.common.ValueObject vo,
                                  java.lang.String validationKey)
                           throws java.lang.Exception
Does the VO's validation check.

Parameters:
request - The HTTP request we are processing
vo - The VO mapping the user transmitted value
validationKey - The form name defining the validation.xml
Returns:
ValidatorError
Throws:
java.lang.Exception

validate

protected ValidatorError validate(javax.servlet.http.HttpServletRequest request,
                                  anyframe.common.ValueObject vo,
                                  java.lang.String validationKey,
                                  int page)
                           throws java.lang.Exception
Does the validation check of VO.

Parameters:
request - The HTTP request we are processing
vo - The VO mapping the user transmitted value.
validationKey - The form name defined in validation.xml.
page - The page for setting in the Validator.
Returns:
ValidatorError
Throws:
java.lang.Exception

Anyframe Web

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