Beginner question

2 views
Skip to first unread message

Enrique

unread,
Oct 23, 2009, 10:12:16 PM10/23/09
to UrlRewrite
Hello I just found urlrewrite and tested it with Struts 2.

This is my rule

<rule>
<from>/test/status/</from>
<to type="redirect">%{context-path}/HelloWorld.action</to>
</rule>

So when I go to http://localhost/test/status/ I'm redirected to
Struts HelloWorld.action which is ok
but then the url changes to this http://localhost/HelloWorld.action
but I want the url to remain like this http://localhost/test/status/

Avlesh Singh

unread,
Oct 24, 2009, 8:30:16 AM10/24/09
to urlre...@googlegroups.com
Remove the type="redirect" attribute from your <to> part of the rule.
The default value is "forward", and I guess that is what you want.

Cheers
Avlesh

Enrique

unread,
Oct 26, 2009, 9:52:27 PM10/26/09
to UrlRewrite

Thank you.
That did the trick!!


On Oct 24, 6:30 am, Avlesh Singh <avl...@gmail.com> wrote:
> Remove the type="redirect" attribute from your <to> part of the rule.
> The default value is "forward", and I guess that is what you want.
>
> Cheers
> Avlesh
>
> On 10/24/09, Enrique <enrique.garcia.c...@gmail.com> wrote:
>
>
>
> > Hello I just found urlrewrite and tested it with Struts 2.
>
> > This is my rule
>
> > <rule>
> >         <from>/test/status/</from>
> >         <to type="redirect">%{context-path}/HelloWorld.action</to>
> > </rule>
>
> > So when I go tohttp://localhost/test/status/I'm redirected to
> > Struts HelloWorld.action which is ok
> > but then the url changes to thishttp://localhost/HelloWorld.action
Reply all
Reply to author
Forward
0 new messages