> -----Original Message----- > From: Geeta Ramani [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 15, 2004 12:01 PM > To: Struts Users Mailing List (E-mail) > Subject: Configuring plug-ins using <set-property tag (in > struts-config.xml) > > > Hi all: > > I have a question regarding the use of plug-ins. According to > the docs, > > "For PlugIns that require configuration themselves, the > nested <set-property> element is available." > > My question is simply this: how do I retrieve the value that > I set in a set-property tag? I am sure this is dead simple to > most of you, but even after googling for two hours and > looking at the source code for the tiles plug-in I seem to be > going nowhere...(:( From http://struts.apache.org/api/org/apache/struts/action/PlugIn.html I read: Configuration can be accomplished by providing standard JavaBeans property setter methods, which will all have been called before the init() method is invoked.
I can assume that something like this would work: public class SomeLogicalClassName implements Plugin { private String aWellNamedPropertyFieldYouWantToSet; public void get... public void set... } and in your config: <plug-in className="package.path.to.SomeLogicalClassName"> <set-property property="aWellNamedPropertyFieldYouWantToSet" value="A configuration value" /> </plug-in> and voila! your plugin is configured. Maybe... I could be talking out of my hat here. But that seems logical. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]