struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cedric Dumoulin <ced...@apache.org>
Subject Re: cvs commit: jakarta-struts/src/share/org/apache/struts/action ActionServlet.java
Date Sun, 29 Dec 2002 22:06:40 GMT

  Hi Christopher,

  I have change again the way the pluginConfig object is passed. The 
implementation now uses the PropertyUtils.setProperty(...) method, and 
catch the exception if the property doesn't exist.
  Can you tell us if this work for you ?

  Normally ActionServlet, and all struts classes should log every 
messages throw the common-logging mechanism. If this is not the case, 
you can report faulty places in bugzilla.

  Thanks for your feedback,

       Cedric

Christopher Lenz wrote:

> Cedric,
>
> this seems to have broken the Validator plug-in, at least when running 
> under the J2EE reference implementation, which uses pretty strict 
> security restrictions by default. Maybe not even the Tiles plug-in is 
> running under that environment anymore, I have only tested the 
> Validator plug-in however.
>
> This is caused by BeanUtils throwing an exception if the requested 
> property isn't declared... BeanUtils tries to use setAccessible(true), 
> which triggers an AccessControlException. At least that's what I 
> understand.
>
> On a related note, I think the ActionServlet (and others) should log 
> everything through Commons-Logging, and not just some messages while 
> others get logged through the ServletContext. This "distribution" of 
> log messages made it *really* hard to track this problem down on the 
> J2EE-RI server.
>
> cedric@apache.org wrote:
>
>> cedric      2002/12/27 02:52:22
>>
>>   Modified:    src/share/org/apache/struts/action ActionServlet.java
>>   Log:
>>   Pass the current plugIn config object to the PlugIn during 
>> initialization.
>>   The object is passed as a property of the plugin. The plugin should 
>> declare a
>>   property "currentPlugInConfigObject" to be able to receive the 
>> config object.
>>   The property is set only if the plugin declares it.
>>   This plugin config object is needed by Tiles.
>>     Revision  Changes    Path
>>   1.138     +9 -5      
>> 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.137
>>   retrieving revision 1.138
>>   diff -u -r1.137 -r1.138
>>   --- ActionServlet.java    22 Dec 2002 05:31:14 -0000    1.137
>>   +++ ActionServlet.java    27 Dec 2002 10:52:22 -0000    1.138
>>   @@ -1093,7 +1093,11 @@
>>                    plugIns[i] =
>>                        
>> (PlugIn)RequestUtils.applicationInstance(plugInConfigs[i].getClassName()); 
>>
>>                    BeanUtils.populate(plugIns[i], 
>> plugInConfigs[i].getProperties());
>>   -                    plugIns[i].init(this, (ModuleConfig) config);
>>   +                  // 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]);
>>   +                plugIns[i].init(this, (ModuleConfig) config);
>>                } catch (ServletException e) {
>>                    // Lets propagate
>>                    throw e;
>
>


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


Mime
View raw message