There is a quick note on set-property in the user guide [1], but I agree, it
isn't very clear.

Here is how <set-property> works, using an ActionMapping as the example:
  - <set-property property="foo" value="bar" />  will have Struts call
setFoo("bar") on the action mapping at startup, used when you have a custom
ActionMapping class
  - <set-property key="foo" value="bar"/> will have Struts call
actionMapping.setProperty("foo", "bar) at startup (although the wildcard
capability still does the replacement at request time).  You can then
retrieve this value in your action by calling actionMapping.getProperty
("foo")

Hope that helps,

Don

[1]
http://struts.apache.org/struts-action/userGuide/building_controller.html#action_mapping_wildcards

On 4/25/06, ben.christenson <[EMAIL PROTECTED]> wrote:
>
>
> OK, I have your first example working, and as you said it has gottem me
> almost there.  However, I have a few things that I am getting caught on
> for
> the second example.  First, you mention that the ability to use wildcards
> in
> a set-property element is new to Struts 1.3, however I can't find any
> information or source for that version (outside of the version notes on
> the
> main struts sight).  Can you let me know where to find this?  Second, I
> don't think I have a very firm grasp of how "properties" are used in
> Struts.
> I have done some web searches, but most are just setting properties for
> already existing classes.  Can you explain a bit more about how properties
> are typically used and specifically how to access them from within a
> DispatchAction?
>
> Thanks,
> Ben
> --
> View this message in context:
> http://www.nabble.com/Struts-Equiv-to-RoR%27s-controller%2C-action%2C-id-t1489136.html#a4087573
> Sent from the Struts - User forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to