if you rewrite the URL you have to take care of the context
yourself. 

you could use the PageRenderLinkSource service to 
create a Link with the desired context and return the 
generated url :

Link link = pageLinkSource.createPageRenderLinkWithContext(
        DocumentExportPage.class, "my","context", "values");

return new SimpleRequestWrapper(request, link.toRedirectURI());


g,
kris




Jan Jirout <jir...@coroptis.com> 
30.01.2010 22:58
Bitte antworten an
"Tapestry users" <users@tapestry.apache.org>


An
Tapestry users <users@tapestry.apache.org>
Kopie

Thema
problem with component







Hi All,

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");
      }

It works fine. Problem is with page context in case of component events. 
If component event with some context is passed into previous 
URLRewriterRule then page context is lost. Only way how to avoid this 
problem is following adjustment:

      public Request process(Request request, URLRewriteContext context) {
          if (context.getPageParameters() == null) {
            /**
             * it's component event
             */
            return request;
          }
          return new SimpleRequestWrapper(request, "somePath");
      }


In this case component events are not processed so context is preserved. 
Problem is that component event URLs are not adjusted. Even following 
example lost component event context.

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

Do you have any clue how to process component events without lost context?

thanks

Jan

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


Reply via email to