Java – system. In Tomcat Scope of setproperty
•
Java
This question is the "cousin" of this one involved Android But here we are in the Tomcat environment
If in my webapp, I use system setProperty(“property_name”,“property_value”); A property is set. Which range will it apply to?
>All JVMs in the machine > all Tomcat webapps > only webapps executing instructions > only threads executing instructions > others
Thank you.
Solution
System properties have JVM scope Therefore, this property will be modified (and available) for all web applications and Tomcat itself throughout the Tomcat JVM
Note that system properties are stored in memory, so if you stop and restart tomcat, they will not be retained
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码