You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bradley G Smith <bg...@fs.fed.us> on 2002/11/19 16:39:49 UTC

PlugIn - and PlugIn Properties

Does someone have a good example of using a Struts PlugIn with PlugIn
properties they would be willing to share. I tried to follow the code in
the Tiles PlugIn but this seemed to be overly complex for what I need.

Thanks,

Brad Smith



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: PlugIn - and PlugIn Properties

Posted by Eddie Bush <ek...@swbell.net>.
Take a look at the validator's plugin.  Basically what happens is that 
you use the set-property element to set the properties of your plugin. 
 It's really straight-forward.  Just use the same name in the 
set-property element as the name of your plugin property.  I used the 
ValidatorPlugIn for my example simply because it's not as complex as the 
TilesPlugIn.

ex:  for a property named myProperty, which has an accessor/mutator 
named getMyProperty/setMyProperty, you'd do:

  <plug-in className="com.foo.MyPlugIn">
    <set-property property="myProperty"
                  value="someValue - probably a String ;-)"/>
  </plug-in>

You needn't concern yourself with anything other than using the 
properties in your plugin (call your getter or refer to the field 
directly), since they automatically get set for you.

Bradley G Smith wrote:

>Does someone have a good example of using a Struts PlugIn with PlugIn
>properties they would be willing to share. I tried to follow the code in
>the Tiles PlugIn but this seemed to be overly complex for what I need.
>
>Thanks,
>
>Brad Smith
>

-- 
Eddie Bush





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>