struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mr...@apache.org
Subject cvs commit: jakarta-struts/contrib/struts-chain/src/java/org/apache/struts/chain CreateActionForm.java
Date Fri, 09 Apr 2004 15:17:43 GMT
mrdon       2004/04/09 08:17:43

  Modified:    contrib/struts-chain/src/java/org/apache/struts/chain
                        CreateActionForm.java
  Log:
  Updated for the new DynaActionFormClass creation signature
  
  Revision  Changes    Path
  1.5       +31 -2     jakarta-struts/contrib/struts-chain/src/java/org/apache/struts/chain/CreateActionForm.java
  
  Index: CreateActionForm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/contrib/struts-chain/src/java/org/apache/struts/chain/CreateActionForm.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CreateActionForm.java	8 Mar 2004 02:50:53 -0000	1.4
  +++ CreateActionForm.java	9 Apr 2004 15:17:43 -0000	1.5
  @@ -30,6 +30,7 @@
   import org.apache.struts.chain.util.ClassUtils;
   import org.apache.struts.config.ActionConfig;
   import org.apache.struts.config.FormBeanConfig;
  +import org.apache.struts.config.ModuleConfig;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  @@ -50,6 +51,7 @@
       private String actionConfigKey = Constants.ACTION_CONFIG_KEY;
       private String actionFormKey = Constants.ACTION_FORM_KEY;
       private String actionServletKey = Constants.ACTION_SERVLET_KEY;
  +    private String moduleConfigKey = Constants.MODULE_CONFIG_KEY;
   
       private static final Log log =
           LogFactory.getLog(CreateActionForm.class);
  @@ -133,6 +135,31 @@
           this.actionServletKey = actionServletKey;
   
       }
  +    
  +    /**
  +     * <p>Return the context attribute key under which the
  +     * <code>ModuleConfig</code> for the currently selected application
  +     * module is stored.</p>
  +     */
  +    public String getModuleConfigKey() {
  +
  +        return (this.moduleConfigKey);
  +
  +    }
  +
  +
  +    /**
  +     * <p>Set the context attribute key under which the
  +     * <code>ModuleConfig</code> for the currently selected application
  +     * module is stored.</p>
  +     *
  +     * @param moduleConfigKey The new context attribute key
  +     */
  +    public void setModuleConfigKey(String moduleConfigKey) {
  +
  +        this.moduleConfigKey = moduleConfigKey;
  +
  +    }
   
   
       // ---------------------------------------------------------- Public Methods
  @@ -221,8 +248,10 @@
           log.trace("Make a new instance of: " + formBeanConfig);
           // Create a new form bean instance
           if (formBeanConfig.getDynamic()) {
  +            ModuleConfig moduleConfig = (ModuleConfig)
  +                wcontext.get(getModuleConfigKey());
               DynaActionFormClass dynaClass =
  -                DynaActionFormClass.createDynaActionFormClass(formBeanConfig);
  +                DynaActionFormClass.createDynaActionFormClass(formBeanConfig, moduleConfig);
               instance = (ActionForm) dynaClass.newInstance();
               ((DynaActionForm) instance).initialize
                   ((ActionMapping) actionConfig);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message