You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ilya Obshadko <il...@gmail.com> on 2009/11/24 12:07:53 UTC

determine current page context from component

Is there a way to determine current page context from within a component?

Use case: suppose you have a component that appears on every page and
contains login form.
It is obviously desirable to return to the same page with the same context
after user submits logon information.
Returning null from onSuccess () just redirects to the same page, and
context is missing after submit.


-- 
Ilya Obshadko

Re: determine current page context from component

Posted by Ilya Obshadko <il...@gmail.com>.
Thanks, it worked.

On Tue, Nov 24, 2009 at 5:17 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Em Tue, 24 Nov 2009 09:07:53 -0200, Ilya Obshadko <il...@gmail.com>
> escreveu:
>
>
>  Is there a way to determine current page context from within a component?
>>
>
> AFAIK no.
>
>
>  Use case: suppose you have a component that appears on every page and
>> contains login form.
>> It is obviously desirable to return to the same page with the same context
>> after user submits logon information.
>>
>
> The component should check the session or some service for this
> information, not get it from the page activation context.
> Your login component could use the Request service to get the requested
> URL, store it somewhere and then use it to the desired redirect.
>
>

-- 
Ilya Obshadko

Re: determine current page context from component

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Tue, 24 Nov 2009 09:07:53 -0200, Ilya Obshadko  
<il...@gmail.com> escreveu:

> Is there a way to determine current page context from within a component?

AFAIK no.

> Use case: suppose you have a component that appears on every page and
> contains login form.
> It is obviously desirable to return to the same page with the same  
> context after user submits logon information.

The component should check the session or some service for this  
information, not get it from the page activation context.
Your login component could use the Request service to get the requested  
URL, store it somewhere and then use it to the desired redirect.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, 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