cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkrishna <gkris...@interchange.ubc.ca>
Subject Re: Apples block does not have sendPageAndWait
Date Fri, 01 Apr 2005 18:33:24 GMT
-----Original Message-----

> Date: Fri Apr 01 04:55:47 PST 2005
> From: "Leszek Gawron" <lgawron@apache.org>
> Subject: Re: Apples block does not have sendPageAndWait
> To: users@cocoon.apache.org
>
> Bruno Dumon wrote:
> > On Fri, 2005-04-01 at 13:51 +0200, Leszek Gawron wrote:
> > 
> >>gkrishna wrote:
> >>
> >>>The apples block does demonstrate the flow control even when a user with
what if attitude presses 'browser back button' or clone a page.
> >>>
> >>>there is no sendPageAndWait functionality in the Apples example CalculationApple.java.
It only uses sendPage function.
> >>>
> >>>sendPage is used normally for terminating the flow. ie., user should not
be able to change the values of the shopping cart after the submit button is pressed. But
the javascript does the same through k.invalidate(), 
> >>>but in java it is not the same case.
> >>
> >>There is no sendPageAndWait in Apples because Apples flow controller is 
> >>stateless. If you want to build stateful applications you have to manage 
> >>state yourself and store the information in session for example.
> > 
> > 
> > Apples is stateful, not stateless. You don't need the session to store
> > information, you can just put it in instance variables of the apple.
> > Apples doesn't do continuations, therefore there's no sendPageAndWait
> > method, each new request starts at the beginning of the apples' process
> > method.
> Sorry for the mess. I must have got it wrong.
> Still you have to track the place where you are in your page flow by 
> yourself.
> 
> -- 
> Leszek Gawron                                                 MobileBox
> lgawron@apache.org                              >http://www.mobilebox.pl

Thanks for clearing my doubt. I was looking for a java based continuation example to handle
back button and creating new browser scenarios. The pet store applicaton uses javascript based
continuation to accomplish the same. 
The existing javaflow based continuation solution in samples do not deal with back button
and new browser (clone page) scenario.

I was looking at the apples block (java based) so to see if it can solve the problem and glad
to know that apples block dont use continuation.

well, if i want to accomplish the back button and clone page scenario in existing calculator
javaflow block sample, 
i think i have to import WebContinuation.java and assign a variable to the sendPageAndWait
of applications entry method 
and then call variable.dispose() before final sendPage() (by clicking submit button) , so
that the rest of the continuation tree is destroyed.
Thus, if the user tries press back button or clone page in the middle of flow, he wont be
change the values of the application after the submit button of any one the page is pressed
(ie., after termination of the application).

Please let me know if my flow is correct. 
i would appreciate your reply.

thanks,

krishna


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


Mime
View raw message