I haven't tried this, but have been thinking of.
How about using HTML5 storage, there are a few APi out there, so, as
the user enters data in the forms, you store the data on the client,
and then, your submit button can call a JS function that collects
those values, and submits them, with something like jsonCall.
So, if the users enters data in 10 fields, clicks submit, the server
crashes, , he/she reloads the page, the old data will be there, and
the new submit will go to the live server.
For info on reading fields and sending them with jsonCall, see
https://fmpwizard.telegr.am/blog/adding-fields-dynamically-lift
Regards,
Diego
On Wed, Sep 19, 2012 at 11:40 AM, jean rossier <
jean.r...@gmail.com> wrote:
> Hello,
>
> I'm developing a web application mainly composed of forms to display/insert
> various information about events. So far, I was working with a single server
> (Jetty) that was deploying my app.
> Now, I want to add some high availability and rolling upgrade features. For
> that, I follow the guidelines of Thimothy Perrett in his book (Lift in
> action, chapter 15). I now have two instance of my app running, and an NGINX
> server above them that does the load balancing. And it works pretty well.
> However, since I have many forms that are filled by the users, I would like
> that if one server crashes while a user in entering some data, the data is
> not lost when the user presses "submit".
> So far, I've mostly used Ajax forms
> (
http://simply.liftweb.net/index-4.8.html) and they work very well with a
> single server. But with my new configuration (two servers, load-balanced),
> if the server that is serving my current page crashes while I'm filling up a
> form, it breaks the normal behavior. The submit button has actually no
> action. I thus have to reload the full page (that will be served by the
> second server), re-enter my data and submit the form. That will work, but it
> is very annoying for the user.
> I also tested with non-ajax forms and RequestVar
> (
http://simply.liftweb.net/index-4.4.html) but the behavior is the same.
>
> My question is thus the following: Is there a way in Lift (with my
> configuration: two server, load-balanced) to have "robust" forms (data is
> not lost when a server crashes while a user is filling up a form) ? if yes,
> how ?
>
> Thanks for the help,
> Jean
>
> --
> --
> Lift, the simply functional web framework:
http://liftweb.net
> Code:
http://github.com/lift
> Discussion:
http://groups.google.com/group/liftweb
> Stuck? Help us help you:
>
https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>
>
--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com