Can I use Singleton inside the servlet to exchange information between different sessions.
I know that only 1 instance of Servlet is running at any time. Call method for each incoming request. But what about creating another Singleton class (like ShareSingleton) that calls its getInstance () in the servlets init () method. This ShareSingleton can transfer data that should be shared between sessions / reqests.
How risky is this approach in servlets?
source
share