Hey Levi,

That's almost identical to what I need for my application. Sorry I missed your 
post back in Feb, I had a two week holiday mid feb so I wasn't following. You 
did this the same way as me by creating your own PageRenderDispatcher and 
LinkFactory. My scenario is possibly a little more complex because if there's a 
T5 page at /SITE/page then it uses that, if not and SITE is recognised as a 
configured site then it's moved to the end of the URL. (becoming the last 
context param)

I'm now migrating to T5.1.0.2 and looking at how I should implement this now. 
That's why I was looking at URL rewriting to see if it was appropriate for this 
task in 5.1 - I wasn't looking at the nightly docs though. Now I am and I can 
see what Thiago means but I don't think URL rewriting is the right place to do 
this. I'm leaning towards a custom implementation of ComponentEventLinkEncoder 
(possibly extending the internal T5.1 impl) since the URL analysis which is 
going on in here is what I need to figure out what (if anything) needs doing to 
the URL.

Are there any other ways of doing this, and is this the best? Opinions welcome.

Thanks,
Andy.

> -----Original Message-----
> From: xfile80303 [mailto:l...@grokers.net]
> Sent: 30 March 2009 23:28
> To: users@tapestry.apache.org
> Subject: Re: T5.1 URL Rewriting
> 
> Perhaps a better example is needed...
> 
> I want to insert the notion of "site" into the URL and application,
> such that I can use the same pages to render content, but these pages
> can have access to what "site" they are currently rendering and change
> behavior, look and feel, whatever.  The site parameter would need to be
> available for all pages, not just a page context parameter, so the
> application url looks something like:
> 
> http://myhost.com/SITE/page/params
> 
> Where the only difference from normal Tapestry URL is the insertion of
> the SITE before the rest of the URI, such that SITE could be anything
> (like, "partner", "foo", or "main" etc.).
> 
> So the URL Rewriting implementation does not seem to be quite a match
> since if I insert anything for SITE, as mentioned, it breaks Tapestry's
> ability to properly deal with the request for pages and page content,
> etc.  The SITE parameter needs to be "virtual" and yet still generated
> for page links.
> 
> Not to cloud the issue, but for reference:
> 
> http://n2.nabble.com/-T5--Struggling-With-Concepts-tt2324920.html
> http://n2.nabble.com/-T5--URL-Manipulation-tt2276010.html
> 
> Since those posts I was able to create a dispatcher which replaced the
> PageRender dispatcher and a LinkFactory which overrides the
> createPageRenderLink functionality to insert the "site" parameter into
> the generated URLs.
> 
> Since 5.1.0.0 there seems to have been a lot of work in this space
> (which is great!) and I was hoping to avoid overriding internal
> functionality in order to accomplish what I needed (and allow for a
> simpler upgrade path in the future).
> 
> Thanks,
> 
> Levi
> 
> 


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

Reply via email to