I've a rather strange problem with Action class's "execute" method and the "TimerTask" class. May be my design is incorrect, but here is the problem.
The "execute" method in my "action" class has logic to lookup the database for a user. If the "user" is not found in the database, it tries to push the user information into the database. The database update takes some amount of time to get updated so I cannot display the results for that particular user instantly.
Hence I created a timertask that fires off after ceratin time. the logic inside the timetask tries to query the database and get the user related information. In the mean time, In the mean time I'm trying to show a progress page to the user saying that information is getting retrieved.
Once the timer task has completed its work, it tries to invoke a forward on another page that displays results. (An inner class is written that extends TimeTask and it fetches data from database)
I'm not able to forward to the results page from "timertask" class. I was wondering if anyone can help me solve this issue.
You can't push the results to the browser if a response (the wait page) was already returned; the browser must make another request to see if the process is completed.
A common way of handling this is to include a delayed refresh in your wait page to ask the server, "Are you done yet?" If the process has not completed, the server will respond with the wait page again.
A good workman is known by his tools.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com