struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Don Brown" <>
Subject Re: Struts Equiv to RoR's controller, action, id
Date Tue, 25 Apr 2006 18:33:11 GMT
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

Hope that helps,



On 4/25/06, ben.christenson <> 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:
> Sent from the Struts - User forum at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message