You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by abhishek jain <ab...@gmail.com> on 2011/02/11 11:18:38 UTC
urlrewrite and calling appropriate method on a url type index.action?type=product&otherparam=abc
hi,
if i have a url like abc.com/abc.phtml
and i want to convert that into
index.action?type=product&otherparam=abc
i think i can do via urlrewrite, i have done this in struts1 and not sure
how to do in struts 2.
Also, how will i call the method product () in the action(from url
index.action?type=product&otherparam=abc) call i mean what configuration
will i use,
pl. advice more specifically for the second ques.
--
Thanks and kind Regards,
Abhishek jain
Re: urlrewrite and calling appropriate method on a url type index.action?type=product&otherparam=abc
Posted by Alex Lopez <al...@flordeutopia.pt>.
I would better rewrite the method into part of the action name, before
the params, and use wildcards both for the action name and the method
(or just for the method), something like:
<action name="*-*" class="package.{1}" method="{2}">
have a look at:
http://struts.apache.org/2.x/action-configuration.html
http://struts.apache.org/2.x/wildcard-mappings.html
Em 11-02-2011 10:18, abhishek jain escreveu:
> hi,
> if i have a url like abc.com/abc.phtml
> and i want to convert that into
>
> index.action?type=product&otherparam=abc
>
> i think i can do via urlrewrite, i have done this in struts1 and not sure
> how to do in struts 2.
>
> Also, how will i call the method product () in the action(from url
> index.action?type=product&otherparam=abc) call i mean what configuration
> will i use,
>
>
> pl. advice more specifically for the second ques.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org