I have created a ClientSide State for XPages, which allows horizontal scaling of XPages applications with a single click.
After installing the OSGi Plugin on the servers and the DDE, you can activate it with a single click:
Then, the State of the XPages application view is stored on client side (in the field „$$clientstate„), and not on the server anymore. The State is AES-128 encrypted and uses some random bytes for a higher security.
You can find the code on GitHub.
P.S.
Parts of the code are shamelessly stolen from Jesse.
Hello Sven,
could you tell us a bit more about why you needed to do this and what it does ( in simple terms ). Is it letting you use more XPage servers in parallel ? Did you hit a limit ?
Thanks, Sean
Normally, the state of any XPages
applicationview is stored on the server where the application is hosted (in memory or on disc). When the session and/or the application is timed out, this state is discarded. Or if you have multiple servers, you cannot switch between them (f.e. with Round Robin, or if one server crashes).With this solution, the state is now stored in the browser and is sent to the server during a request. If you store it in the local storage of the client, you could even shutdown the PC and continue your work some days later (To prevent a manipulation, the state is AES encrypted).
The price for this is that the state has to be added to every request (and current ly to any response).
Hope this gives you some insights.
Very nice 🙂
what is the „state“ of an application ?
Sorry, not the state of an application, the state of the view.
Hello Sven, I just came across this again today via Twitter – thanks for posting and gitting,
https://twitter.com/seancull/status/1094991609811398656
Has the code worked well for you over the years in between ?
thanks, Sean
Hi Sean,
yes, it worked well.