I am using Struts2 with Spring plugin. I want to set a variable value which will be shared among all the different sessions. It will just be one string value but if one session changes it I want the changed value to be available to all the sessions.
What will be the best way to do this? Code Example will be great.
http://docs.oracle.com/cd/E17802_01/products/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html
In the Servlet code:
This is the generic Java EE Servlet way ;)
You can do something like this using Spring
In rest of code you just get the servletContext object from request->session and get the value of "mykey".