You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Rich M <ri...@moremagic.com> on 2011/03/01 17:03:34 UTC

Capturing action, event, form requests

Hi,

I currently have a Dispatcher implementation to handle page and asset 
requests in order to process authentication and security logic as 
necessary. However, it appears to me that (at least in 5.1) the 
Dispatcher does not intercept any ActionLinks, EventLinks, form events, 
or otherwise related client-side triggers that are not page requests.

Is there a service or service interface to implement that would provide 
an opportunity to step in and intercept these requests before a 
page/component catches them?

Thanks,
Rich

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


Re: Capturing action, event, form requests

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 01 Mar 2011 14:55:52 -0300, Rich M <ri...@moremagic.com> wrote:

> Oh, I see. Perhaps then it's reasonable to say I was mislead by this  
> Tapestry wiki page    
> http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher ? This  
> is pretty much exactly what I adapted to my application half a year ago,  
> 'AccessController' name and all.

That's a wiki page, not part of the official documentation.

> I am in fact using the Dispatcher to redirect to a login page with an  
> expired context, I suppose I'm not entirely clear yet between the Wiki  
> and my working implementation why Dispatcher isn't appropriate.

In this case, thinking it over, it's not inappropriate, just not as  
appropriate as a filter.

> Perhaps its a case of, 'it will work, but that's not what it was meant  
> for'? Or are there some nuances to the ComponentRequestHandler pipeline  
> that make it a more robust authentication point?

It's only invoked for page render and event requests, not for asset ones.

-- 
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
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Capturing action, event, form requests

Posted by Rich M <ri...@moremagic.com>.
On 03/01/2011 11:26 AM, Thiago H. de Paula Figueiredo wrote:
> On Tue, 01 Mar 2011 13:03:34 -0300, Rich M <ri...@moremagic.com> wrote:
>
>> Hi,
>
> Hi!
>
>> I currently have a Dispatcher implementation to handle page and asset 
>> requests in order to process authentication and security logic as 
>> necessary. However, it appears to me that (at least in 5.1) the 
>> Dispatcher does not intercept any ActionLinks, EventLinks, form 
>> events, or otherwise related client-side triggers that are not page 
>> requests.
>
> These scenarios should be handled by implementing one of the Tapestry 
> filter pipelines.
> Dispatchers are supposed to return content after handling a request.
>
Oh, I see. Perhaps then it's reasonable to say I was mislead by this 
Tapestry wiki page 
http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher ? This 
is pretty much exactly what I adapted to my application half a year ago, 
'AccessController' name and all.
>> Is there a service or service interface to implement that would 
>> provide an opportunity to step in and intercept these requests before 
>> a page/component catches them?
>
> Implement a ComponentRequestFilter and contribute it to the 
> ComponentRequestHandler service.
>
Thanks, I'll look into that. Going back and looking at that wiki page 
though I realized that it was ordering the AccessController with 
before:PageRender, I switched it to before:RootPath and it seems to now 
capture the events I was talking about and solved a related problem I had.

I am in fact using the Dispatcher to redirect to a login page with an 
expired context, I suppose I'm not entirely clear yet between the Wiki 
and my working implementation why Dispatcher isn't appropriate. Perhaps 
its a case of, 'it will work, but that's not what it was meant for'? Or 
are there some nuances to the ComponentRequestHandler pipeline that make 
it a more robust authentication point?

Thanks,
Rich


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


Re: Capturing action, event, form requests

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 01 Mar 2011 13:03:34 -0300, Rich M <ri...@moremagic.com> wrote:

> Hi,

Hi!

> I currently have a Dispatcher implementation to handle page and asset  
> requests in order to process authentication and security logic as  
> necessary. However, it appears to me that (at least in 5.1) the  
> Dispatcher does not intercept any ActionLinks, EventLinks, form events,  
> or otherwise related client-side triggers that are not page requests.

These scenarios should be handled by implementing one of the Tapestry  
filter pipelines.
Dispatchers are supposed to return content after handling a request.

> Is there a service or service interface to implement that would provide  
> an opportunity to step in and intercept these requests before a  
> page/component catches them?

Implement a ComponentRequestFilter and contribute it to the  
ComponentRequestHandler service.

-- 
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
For additional commands, e-mail: users-help@tapestry.apache.org