I’m looking for Java (Tomcat) equivalent for HttpApplication in ASP.NET. My business requires to store some temporary data globally at runtime. I would like to do it in HttpApplication if I’m using ASP.NET. What is the Java approach with Tomcat?
Furthermore, I’m using Tomcat cluster + memcached session manager with non-session sticky in backend. Both session and application data are expected to be replicated in realtime.
Any comments? Thanks.
The equivalent is the ServletContext that you can access using getServletContext in your servlet. In JSP you can access it with the application variable.
You can store your data in the context attribute Map.
Tomcat cluster replicates sessions and servlet context attributes