Nathan,

Can't you just add getters and setters to your mypluginclass so set-property
works directly on them? *scratches his head in confusion*  That seems to be
the way the DigestingPlugIn does it in the example application.

v1.2.4 frozen cvs DigestingPlugIn code from it's WEB-INF/struts-config.xml:
http://svn.apache.org/viewcvs.cgi/struts/core/trunk/web/example/WEB-INF/stru
ts-config.xml?rev=57589&view=auto

<plug-in className="org.apache.struts.plugins.DigestingPlugIn">
    <set-property property="key" value="serverTypes"/>
    <set-property property="configPath" value="/WEB-INF/server-types.xml"/>
    <set-property property="digesterPath"
value="/WEB-INF/lvb-digester-rules.xml"/>
  </plug-in>


v1.2.4 frozen CVS DigestingPlugIn code:
http://svn.apache.org/viewcvs.cgi/struts/core/trunk/src/share/org/apache/str
uts/plugins/DigestingPlugIn.java?rev=57589&view=auto

See the setKey(String key) ...
See the setConfigPath(String configPath) ...
See the setDigesterPath(String digesterPath) ...

Regards,
David

-----Original Message-----
From: Nathan Coast [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 24, 2004 7:00 PM
To: struts-user
Subject: plugin config confusion


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]

Reply via email to