Rick,

You can already accomplish what you are describing
with the current Struts architecture via
<set-property> elements.

<action ...>
  <set-property property="prop" value="val">
</action>

This will call the setProp(String value) method of
your action object with the "val" value.

The Struts Console makes it easy for setting these
properties on actions.

http://www.jamesholmes.com/struts/

-james
[EMAIL PROTECTED]


--- Rick Mann <[EMAIL PROTECTED]> wrote:
> I've noticed a few people proposing solutions for
> various framework
> limitations that use the "param" attribute of the
> <action> tag. Obviously,
> only one parameter can reasonably be passed in this
> attribute.
> 
> Does it not make sense to add a nested tag for
> parameters? In the build of
> Struts that I'm using, I haven't noticed anything
> like this. I was thinking
> along the lines of something like this:
> 
>     <action path = "/someaction"
>             type = "com.foo.bar.action.Action">
> 
>         <param name="param1" value="value1" />
>         <param name="param2" value="value2" />
>     </action>
> 
> Or, if you want to get XML-happy:
> 
>     <action path = "/someaction"
>             type = "com.foo.bar.action.Action">
> 
>         <action-param>
>             <param-name>param1</param-name>
>             <param-value>value1</param-value>
>         </action-param>
>     </action>
> 
> but I don't know if that's strictly necessary (I'll
> let the smarter people
> on the project decide).
> 
> In any event, in the code, you could write something
> like:
> 
>     String val1 = mapping.getParameter("param1");
>     String val2 = mapping.getParameter("param2");
> 
> The method shouldn't even need to be named
> differently, as the existing
> getParameter() takes no arguments. There would
> obviously be corresponding
> setParameter(String) calls.
> 
> How does this seem?
> 
> -- 
> Rick
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to