jp.terasoluna.fw.web.struts.form
Class ActionFormUtil

java.lang.Object
  extended by jp.terasoluna.fw.web.struts.form.ActionFormUtil

public class ActionFormUtil
extends java.lang.Object

Utility class related to the action form.

In this class, the functions which are used in action form processing are consolidated as utilities.

See Also:
FormEx, DynaValidatorActionFormEx, ValidatorActionFormEx

Constructor Summary
ActionFormUtil()
           
 
Method Summary
static void clearActionForm(javax.servlet.http.HttpSession session)
          Utility method which deletes all the action forms starting with "_" and stored in session scope.
static void clearActionForm(javax.servlet.http.HttpSession session, java.lang.String exclude)
          Utility method which deletes all the action forms starting with "_" and stored in session scope.
static java.lang.String getActionFormName(javax.servlet.http.HttpServletRequest req)
          Fetches the action form name from the action mapping which is set as HTTP request attribute.
static org.apache.struts.config.FormPropertyConfig getPropertyConfig(java.lang.String fieldName, org.apache.struts.action.ActionMapping mapping)
          Fetches the configuration information of specified field.
static void initialize(org.apache.struts.action.DynaActionForm form, java.lang.String fieldName, org.apache.struts.action.ActionMapping mapping)
          Initializes the specified property value of DynaActionForm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionFormUtil

public ActionFormUtil()
Method Detail

getPropertyConfig

public static org.apache.struts.config.FormPropertyConfig getPropertyConfig(java.lang.String fieldName,
                                                                            org.apache.struts.action.ActionMapping mapping)
Fetches the configuration information of specified field.

Parameters:
fieldName - Field name
mapping - Mapping information
Returns:
FormPropertyConfig

initialize

public static void initialize(org.apache.struts.action.DynaActionForm form,
                              java.lang.String fieldName,
                              org.apache.struts.action.ActionMapping mapping)
Initializes the specified property value of DynaActionForm.

Parameters:
form - DynaActionForm instance
fieldName - Property to be initialized
mapping - Action mapping

clearActionForm

public static void clearActionForm(javax.servlet.http.HttpSession session,
                                   java.lang.String exclude)
Utility method which deletes all the action forms starting with "_" and stored in session scope.

The action forms specified by exclude parameter are not to be deleted.

Parameters:
session - HTTP session
exclude - Action form name which is not to be deleted

clearActionForm

public static void clearActionForm(javax.servlet.http.HttpSession session)
Utility method which deletes all the action forms starting with "_" and stored in session scope.

Parameters:
session - HTTP session

getActionFormName

public static java.lang.String getActionFormName(javax.servlet.http.HttpServletRequest req)
Fetches the action form name from the action mapping which is set as HTTP request attribute.

Parameters:
req - HTTP request
Returns:
Action form name