Hello,
I am looking for a solution to update a .jsp page (kind of progress bar) which shows current progress in a huge simulation when users have to wait for longer periods and the way to do it was have the jsp page refresh often and the page data update by a bean containing the properties file details. The main servlet class continously running on the server regularly updates the properties file.
I am currently using a properties file, which is updated by property IO methods load() and store() which is then accessed by a non-servlet class to read and perform specific actions. Potential problems could be when reading and writing into properties file by two different sources at the same time. Another bigger problem is this works only for one user. This cannot be used by multi-user as the properties file cannot be instantiated/shared unlike a servlet.
The problem is that there cannot be a session or application scoped variable that can be shared between a servlet and non-servlet easily and hence a lack of easier way of communicating with each other.
Any other good solutions to such problems?? Can we add a thread in a servlet which allows us to access a particular variable value in the servlet anywhere else?
Thanks in advance.
Subject: How do we share data between a servlet and a non-servlet when you want to access data that changes in time?