I'm working on a web project. The flow is like this
- User inputs the parameters
- Call to servlet is made (post method)
- The servlet loads a large file (300.000 lines , one word per line) in a tree object. Does some calculations.
- Redirects to a new page for the results.
My question is this. The user may do this operation more than once. The loading of the file to the tree object is taking too long. How can I do this, only once? I've thought to have just one servlet (or jsp) and not redirecting to different pages, but manipulating the view with javascript. This way I think that I will manage to load the file only once (and whenever the user refreshes). Do you have any suggestions?
EDIT 1. This object is created by a class that is called from the servlet. I'm using apache tomcat 7 and java 1.6 . HTML5 is an option too (someone mentioned the history api).