Accessing ServletContext outside of a servlet
问题 I wonder if anyone can advise on a Java webapp question? I have a set standard Java class which has methods to set and get values of a property file. These methods are used system wide and are called by servlets and non-servlet class methods alike. But what I would like to do is to use a ServletContextListener to set the paths to the property file globally rather than hard code them or store them in the database. A ServletContextListener can be used to set 'global variables' for the servlets