Greg Lindholm-2 wrote:
> 
> 
> I have thought about extending the DefaultActionMapper to accept a name
> parameter with a syntax sorta like:
> 
>    name="action:myAction:method:MyMethod:param:name=value"
> 
> I think this would be a useful enhancement. (Maybe someone with more time
> on
> there hands will add it.)
> 
> 

I've had a quick look at the DefaultActionMapper source and it looks like it
might be relatively straight forward to implement a parameter: prefix with a
comma seperated list of key=value and load it into a HashMap and set it on
the ActionMapping.setParms(). However, I'd need to change the <s:submit>
tag.  Would I need to enforce a rule that says that the method: must be
defined to have the parameter: prefix and, if so, where would I do that? I
think that if I just added the parameters: prefix, then Struts would try to
set them on whatever action it decided to map to. It looks like it might be 
easier to persuade it to handle the format
method:MyMethod?parm1=xyz&parm2=abc rather than the format you suggest -
unless I'm misunderstanding the code. By doing it this way, I won't need to
change the <s:submit> tag and I think all I'd need to do is parse the method
name, pull out the ?parm ... string into a hashMap and call setParms on the
ActionMapping in the constructor when prefixTrie is being set up. This would
be more of a hack though.

As an aside are there any reasons why this is not a good idea. There a large
number of better qualified people than me, and that makes me wonder why this
hasn't been done before.


Regards



-- 
View this message in context: 
http://www.nabble.com/More-Convention-Confusion.-tp25816249p25826108.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to