cedric      2002/12/29 13:24:38

  Modified:    src/share/org/apache/struts/action ActionServlet.java
  Log:
  Change the way the ModuleConfig object is passed to a plugin during initialization.
  
  Revision  Changes    Path
  1.139     +11 -6     
jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java
  
  Index: ActionServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
  retrieving revision 1.138
  retrieving revision 1.139
  diff -u -r1.138 -r1.139
  --- ActionServlet.java        27 Dec 2002 10:52:22 -0000      1.138
  +++ ActionServlet.java        29 Dec 2002 21:24:38 -0000      1.139
  @@ -80,6 +80,7 @@
   import javax.sql.DataSource;
   
   import org.apache.commons.beanutils.BeanUtils;
  +import org.apache.commons.beanutils.PropertyUtils;
   import org.apache.commons.beanutils.ConvertUtils;
   import org.apache.commons.beanutils.converters.BooleanConverter;
   import org.apache.commons.beanutils.converters.ByteConverter;
  @@ -1092,11 +1093,15 @@
               try {
                   plugIns[i] =
                       
(PlugIn)RequestUtils.applicationInstance(plugInConfigs[i].getClassName());
  -                BeanUtils.populate(plugIns[i], plugInConfigs[i].getProperties());
  +                 BeanUtils.populate(plugIns[i], plugInConfigs[i].getProperties());
                     // Pass the current plugIn config object to the PlugIn.
                     // The property is set only if the plugin declares it.
                     // This plugin config object is needed by Tiles
  -                BeanUtils.copyProperty( plugIns[i], "currentPlugInConfigObject", 
plugInConfigs[i]);
  +                try {
  +                  PropertyUtils.setProperty(plugIns[i], 
"currentPlugInConfigObject", plugInConfigs[i]);
  +                } catch (NoSuchMethodException e) {
  +                  // silently fail
  +                }
                   plugIns[i].init(this, (ModuleConfig) config);
               } catch (ServletException e) {
                   // Lets propagate
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to