You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Raymond <pp...@hotmail.com> on 2004/11/08 12:53:36 UTC

PageCallback question

Dear Tapestry Users,

I followed the example in Vlib to implement the page callback feature in my
tapestry application, like this:

public class ProtectedPage implements PageValidateListener {
    public void pageValidate(PageEvent event) {
    ...
        Authentication authPage = (Authentication)
getRequestCycle().getPage("Authentication");
        authPage.setCallback(new PageCallback(this));
        throw new PageRedirectException(authPage);
    ...
    }
}

Then in the Authentication page, after successful login, would do the
    page.performCallback();

to get back to the page the user requested before login.

This worked fine if the link to the login page does not contain extra http
request parameters.

Suppose my link to the protected page is something like this
http://myserver.com/myapp/app?service=page/ProtectedPage&my_param=abc
and the rendering of ProtectedPage depends on the value provided by
my_param;

the problem is the http request parameter my_param is lost when the page is
called back after successful login.

Is there any solution to work around this problem (retain the http request
parameters) and still use the page callback mechanism provided by Tapestry?

Thanks very much for help.
Rgds,
Raymond

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


Re: PageCallback question

Posted by Lars Hoss <wo...@acidware.net>.
> You could try using ExternalCallback which can package both a page and
> an arrary of parameters.

Oh, cool! Didn't know this one. Thanks!

Yours,
Lars


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


Re: PageCallback question

Posted by Jonathan Millett <jo...@millett.net>.
You could try using ExternalCallback which can package both a page and
an arrary of parameters.

Raymond wrote:

>Dear Tapestry Users,
>
>I followed the example in Vlib to implement the page callback feature in my
>tapestry application, like this:
>
>public class ProtectedPage implements PageValidateListener {
>    public void pageValidate(PageEvent event) {
>    ...
>        Authentication authPage = (Authentication)
>getRequestCycle().getPage("Authentication");
>        authPage.setCallback(new PageCallback(this));
>        throw new PageRedirectException(authPage);
>    ...
>    }
>}
>
>Then in the Authentication page, after successful login, would do the
>    page.performCallback();
>
>to get back to the page the user requested before login.
>
>This worked fine if the link to the login page does not contain extra http
>request parameters.
>
>Suppose my link to the protected page is something like this
>http://myserver.com/myapp/app?service=page/ProtectedPage&my_param=abc
>and the rendering of ProtectedPage depends on the value provided by
>my_param;
>
>the problem is the http request parameter my_param is lost when the page is
>called back after successful login.
>
>Is there any solution to work around this problem (retain the http request
>parameters) and still use the page callback mechanism provided by Tapestry?
>
>Thanks very much for help.
>Rgds,
>Raymond
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>


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


Re: PageCallback question

Posted by phillip rhodes <rh...@yahoo.com>.
I had the same problem.

I solved it by creating a page property to hold my
extra property and wrote it out as hidden form
parameter so that they would be posted back to the
page.





--- Shing Hing Man <ma...@yahoo.com> wrote:

> I could think of two ways that might solve your
> problem. 
> 
> Method 1) Save the parameters to a Vistor object
> before 
> you go to the authPage . 
> 
> 
> Method 2) Extend the class PageCallback to include 
> a property java.util.List, which holds the
> parameters.
> 
> Shing
> 
> 
> 
> 
>  --- Raymond <pp...@hotmail.com> wrote: 
> > Dear Tapestry Users,
> > 
> > I followed the example in Vlib to implement the
> page
> > callback feature in my
> > tapestry application, like this:
> > 
> > public class ProtectedPage implements
> > PageValidateListener {
> >     public void pageValidate(PageEvent event) {
> >     ...
> >         Authentication authPage = (Authentication)
> > getRequestCycle().getPage("Authentication");
> >         authPage.setCallback(new
> > PageCallback(this));
> >         throw new PageRedirectException(authPage);
> >     ...
> >     }
> > }
> > 
> > Then in the Authentication page, after successful
> > login, would do the
> >     page.performCallback();
> > 
> > to get back to the page the user requested before
> > login.
> > 
> > This worked fine if the link to the login page
> does
> > not contain extra http
> > request parameters.
> > 
> > Suppose my link to the protected page is something
> > like this
> >
>
http://myserver.com/myapp/app?service=page/ProtectedPage&my_param=abc
> > and the rendering of ProtectedPage depends on the
> > value provided by
> > my_param;
> > 
> > the problem is the http request parameter my_param
> > is lost when the page is
> > called back after successful login.
> > 
> > Is there any solution to work around this problem
> > (retain the http request
> > parameters) and still use the page callback
> > mechanism provided by Tapestry?
> > 
> > Thanks very much for help.
> > Rgds,
> > Raymond
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> > 
> >  
> 
> =====
> Home page :
>   http://uk.geocities.com/matmsh/index.html
> 
> 
> 		
>
___________________________________________________________
> 
> Does your mail provider give you a free online
> calendar? 
> Yahoo! does. Get Yahoo! Mail
> http://uk.mail.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 


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


Re: PageCallback question

Posted by Shing Hing Man <ma...@yahoo.com>.
I could think of two ways that might solve your
problem. 

Method 1) Save the parameters to a Vistor object
before 
you go to the authPage . 


Method 2) Extend the class PageCallback to include 
a property java.util.List, which holds the parameters.

Shing




 --- Raymond <pp...@hotmail.com> wrote: 
> Dear Tapestry Users,
> 
> I followed the example in Vlib to implement the page
> callback feature in my
> tapestry application, like this:
> 
> public class ProtectedPage implements
> PageValidateListener {
>     public void pageValidate(PageEvent event) {
>     ...
>         Authentication authPage = (Authentication)
> getRequestCycle().getPage("Authentication");
>         authPage.setCallback(new
> PageCallback(this));
>         throw new PageRedirectException(authPage);
>     ...
>     }
> }
> 
> Then in the Authentication page, after successful
> login, would do the
>     page.performCallback();
> 
> to get back to the page the user requested before
> login.
> 
> This worked fine if the link to the login page does
> not contain extra http
> request parameters.
> 
> Suppose my link to the protected page is something
> like this
>
http://myserver.com/myapp/app?service=page/ProtectedPage&my_param=abc
> and the rendering of ProtectedPage depends on the
> value provided by
> my_param;
> 
> the problem is the http request parameter my_param
> is lost when the page is
> called back after successful login.
> 
> Is there any solution to work around this problem
> (retain the http request
> parameters) and still use the page callback
> mechanism provided by Tapestry?
> 
> Thanks very much for help.
> Rgds,
> Raymond
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
>  

=====
Home page :
  http://uk.geocities.com/matmsh/index.html


		
___________________________________________________________ 
Does your mail provider give you a free online calendar? 
Yahoo! does. Get Yahoo! Mail http://uk.mail.yahoo.com

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