On Fri, Mar 30, 2012 at 5:23 PM, Thiago H. de Paula Figueiredo < thiag...@gmail.com> wrote:
> On Fri, 30 Mar 2012 17:16:00 -0300, Juan Alba <juan.a...@condortech.com.ar> > wrote: > > URLRewriterRule rule = new URLRewriterRule() { >> @Override >> public Request process(Request request, URLRewriteContext context) { >> return new SimpleRequestWrapper(request, >> request.getPath()+"/test"); >> } >> > > You're rewriting all paths from /xxx to /xxx/test, for whatever xxx is. In > other words, your code doesn't much sense. This was a test to understand how it works. So the UrlRewrite is like a redirect? I thought that was only replacing the url for the new url. Like rendering the XXXPage and showing in the url YYYPage. > Each rule needs to check whether it's a path it really wants to rewrite, > and I can't imagine any scenario in which you want to redirect all URLs. > > I am trying to replace all the pages for /facebook/pages. The reason is that my webpage is visited from facebook (embebed in facebook) and in that case I want to show facebook styles. In other case I want to show regular styles. The problem is that facebook is embebing my webpage in a canvas so the only way to know if the webapp is used from facebook or not is by the first hit when a Fb parameter is sent. As I told before, I tried with cookies, sessions and is not a good idea. I was thinking that with this urlrewriter I could add a /facebook/ and then use the request.getPath in the layout to set the corresponding css. any idea for my problem? thanks. > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, > and instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > users-unsubscribe@tapestry.**apache.org<users-unsubscr...@tapestry.apache.org> > For additional commands, e-mail: users-h...@tapestry.apache.org > >