Hi,

thanks for answer.

In my real application I change just pieces of path but it didn't work.

I tried to use following code:

    public Request process(Request request, URLRewriteContext context) {
            return new SimpleRequestWrapper(request, request.getPath());
    }

When I use this code then context of component event is even lost. I didn't find way how to create SimpleRequestWrapper with component even context.

Just in case when I call "return request;" from "process" method is component event context correctly passed.

If you would like to see example application I can send it to conference.

regards

Jan


Thiago H. de Paula Figueiredo wrote:
On Sat, 30 Jan 2010 19:58:34 -0200, Jan Jirout <jir...@coroptis.com> wrote:

Hi All,

Hi!

I have strange problem with URL rewriting. I'm changing path name in URLRewriterRule. In following way:

public Request process(Request request, URLRewriteContext context) {
              return new SimpleRequestWrapper(request, "somePath");
      }

The above rule rewrites *all* URLs to "somePath", losing any context or query parameters. You should use string manipulation to extract the original page name and then replace it with the new page name.

If a request to "/original/1 arrives", your should rewrite it to "/new/1". You can use path.replace("/original/", "/new/") to do that, for example.



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

Reply via email to