Does the object contains all the state of pages,desktop, (like a snapshot) What does an controller object actually store.
Is there any way to store the complete data and components on an page into an object. I want to retrieve same page state.
This shall clear problem:
I want to store complete state of particular portion of web application, and then when I reload the page I want to set the view of the portion that I have saved earlier.
You can do it if you intercept (or wrap) the servlet output stream. You can store content returned by your application per request URL, so you will be able to retrieve the state of the application byte-by-byte.
EDIT.
Here how you can implement this. Controller is a servlet that implements
doGet()and/ordoPost.Here is how the signature of all such methods look like:
protected void doGet(HttpServletRequest req, HttpServletResponse resp)The typical pattern of code looks like:
You can write your own output stream (or writer) that extends OutputStream and wraps 2 palyload streams: servlet stream and file stream. It overrides its write method like the following:
Now each byte is written both to the web client and to file.