The tomcat runs on one JVM. Suppose the tomcat has 2-3 web applications, say A, B and C. A class in web app A declares a static variable int xA = 5; Since there is only one JVM this variable is created there. My question is can class in other web application,B, access this variable through some means if not directly ?. I don't want to use any web services/ rmi etc.
posted 5 years ago
Read in one of the forum that tomcat's inbuilt jndi can be used to attach the object and then this object can be referenced from other servlet context. I have not tried this, though. However, even if this works this will tie my application to tomcat. Any other options ?