struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Musachy Barroso <>
Subject Re: parameters in url
Date Fri, 25 Sep 2009 19:09:54 GMT
committed to trunk. To use it set:

 <constant name="struts.enable.SlashesInActionNames" value="true"/>
 <constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/>
 <constant name="struts.patternMatcher" value="regex" />

to use it with convention, convention needs to be built from trunk.


On Thu, Sep 24, 2009 at 2:19 PM, Musachy Barroso <> wrote:
> I find that using parameters in urls is confusing in struts, and there
> are just too many (and not compatible) ways of doing it, for example,
> if you want to have parameters in front of the action name, like
> /something/param1/param2/ActionName
> you would have to use the "namedVariable" action mapper, but then, you
> cannot have parameters after the action name ("ActionName"). If you
> want to have parameters after the action name, then you can use
> wildcards, and do something like:
> <package name="edit" extends="struts-default" namespace="/edit">
>    <action name="/person/*"
> class="org.apache.struts.webapp.example.EditAction">
>        <param name="id">{1}</param>
>        <result>/mainMenu.jsp</result>
>    </action>
> </package>
> And maybe, you can mix them, but I haven't tried that. I find all this
> very confusing and hard to understand. I would like to do this:
> class MyAction {
>  String param1, param2, param3;
>  @Action("/{param1}/{param2}/MyAction/{param3}")
>  public void execute() {....}
> }
> and the framework should figure out the rest for me. I don't think
> this would be that hard to implement and should provide an unified way
> of handling these type of urls. Thoughts?
> musachy
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd

"Hey you! Would you help me to carry the stone?" Pink Floyd

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message