On Fri, Jun 12, 2009 at 10:23 PM, Blower, Andy<andy.blo...@proquest.co.uk> wrote:
> I recently moved authentication for our project in method advice for the > ComponentEventLinkEncoder method decodePageRenderRequest() because some other > method advice to the same method has some modified URL processing and it > saves duplicating it in an authentication dispatcher. In some situations this > method advice needs to redirect to a single sign on server rather than render > a page, so I have had to override the standard T5 PageRenderDispatcher to > allow this. > > Does anyone else think this is more generally useful and might be a good > enhancement to the standard T5 PageRenderDispatcher? Or is this a very > specific edge case? I'm tempted to raise a JIRA issue, but thought I'd test > the water first. > > > The code uses an extension of EmptyEventContext called RedirectEventContext > to indicate a redirect should take place (bit of hack to avoid API change) > and looks like this: > > public boolean dispatch(Request request, Response response) throws IOException > { > PageRenderRequestParameters parameters = > linkEncoder.decodePageRenderRequest(request); > > if (parameters == null) return false; > > if (parameters.getActivationContext() instanceof > RedirectEventContext) // New block > { > > response.sendRedirect(parameters.getLogicalPageName()); > return true; > } > > componentRequestHandler.handlePageRender(parameters); > > return true; > } > Why not extend the pipeline of dispatchers to accomplish this? I'm very interested in a totally T5 generally available solution to access/authorization mechanism.. -- Massimo http://meridio.blogspot.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org