setting the view to a jsp page from a self refeshing page
I am facing a small problem while setting the view to a jsp page from a self refeshing page
We have a jsp page say first.jsp. On a click of a button it calls a class (say complex.class) that does some processing. After the processing is complete the complex class sets a Flag to true. and sets the view to second.jsp.
The processing is very complex and takes a lot of time to complete, so we need to show a progress page say progress.jsp to the user.
The progress.jsp is a self refreshing page, It calls its command class and checks a flag.
If the flag is false the view is set back to the progress.jsp.
The problem we face is that since there are two threads (1. to progress.jsp and 2. complex.class ) running simultaneously, and the view is set by both the threads, the required view is not set and the code breaks.
Please let me know a way to set the view.