When you include a nested <set-property> element (as you did in your example below), Struts expects your PlugIn implementation class to have a corresponding public property setter method that can be used to pass on that value. Thus, if you have:
<plug-in className="com.mycompany.MyPlugIn"> <set-property name="foo" value="bar"/> </plug-in> then your MyPlugIn class must have a setFoo() method to receive that value. Craig On Thu, 25 Nov 2004 07:59:46 +0800, Nathan Coast <[EMAIL PROTECTED]> wrote: > Hi, > > I'm a bit confused about how you pass config params to a plugin. The > plugin API has no mechanism to set the PluginConfig for a particular plugin. > > The tiles plugin has a method called: > setCurrentPlugInConfigObject(PlugInConfig plugInConfigObject) > and the javadocs state that this is called by the ActionServlet - > although I can't see how as it's not part of the PlugIn interface. > > <plug-in className="mypluginclass" > > <set-property property=".............. > <set-property property="................ > <set-property property="............... > </plug-in> > > AFAICT the only way to access the properties passed to the plugin is to > call > > PlugInConfig[] pics = moduleConfig.findPlugInConfigs(); > > then iterate over pics untill > > if(this.getClass().getName().equals(pics[i].getClassName())) > { > properties = pics[i].getProperties(); > } > > this feels a little awkward, is there a more direct mechanism for a > plugin to access its properties? > > thanks > Nathan > > -- > Nathan Coast > Managing Director > Codeczar Ltd > mob : (852) 9049 5581 > tel : (852) 2834 8733 > fax : (852) 2834 8755 > web : http://www.codeczar.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]