You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by shymon <sh...@poczta.onet.pl> on 2009/10/15 13:35:59 UTC

Login page - passing context between pages


Some pages of my app are available only to authorized users. When user
enters such a page and is not logged in, appropriate message is shown with
link to login page. After logon user should return to the same page he came
from to login page.

So I pass logical name of restricted page and it's context through context
parameter of pageLink. In login page I use onActivate and onPassivate to
maintain source page context. It works great, but when login is successful I
return source page logical name which causes redirect, but rest of the page
context is null. Simply onPassivate called after onSuccess returns array of
nulls. (Inside onSuccess all variables are correctly set).

How can I store source page context through logon process?

-- 
View this message in context: http://www.nabble.com/Login-page---passing-context-between-pages-tp25907016p25907016.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Login page - passing context between pages

Posted by shymon <sh...@poczta.onet.pl>.


DH-14 wrote:
> 
> In that case, the context is only useful for Login page, but not the
> following page, so only returning logic name of source page would not
> carry the context.
> Try PageRenderLinkSource#createPageRenderLinkWithContext(String pageName,
> Object... context) and return that link.
> 

Thanks a lot, it works.
-- 
View this message in context: http://www.nabble.com/Login-page---passing-context-between-pages-tp25907016p25922412.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Login page - passing context between pages

Posted by DH <ni...@gmail.com>.
In that case, the context is only useful for Login page, but not the following page, so only returning logic name of source page would not carry the context.
Try PageRenderLinkSource#createPageRenderLinkWithContext(String pageName, Object... context) and return that link.

DH
http://www.gaonline.com.cn

----- Original Message ----- 
From: "shymon" <sh...@poczta.onet.pl>
To: <us...@tapestry.apache.org>
Sent: Thursday, October 15, 2009 7:35 PM
Subject: Login page - passing context between pages


> 
> 
> Some pages of my app are available only to authorized users. When user
> enters such a page and is not logged in, appropriate message is shown with
> link to login page. After logon user should return to the same page he came
> from to login page.
> 
> So I pass logical name of restricted page and it's context through context
> parameter of pageLink. In login page I use onActivate and onPassivate to
> maintain source page context. It works great, but when login is successful I
> return source page logical name which causes redirect, but rest of the page
> context is null. Simply onPassivate called after onSuccess returns array of
> nulls. (Inside onSuccess all variables are correctly set).
> 
> How can I store source page context through logon process?
> 
> -- 
> View this message in context: http://www.nabble.com/Login-page---passing-context-between-pages-tp25907016p25907016.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
>