I have a JSP web site, not Spring MVC, and it has a config file web.xml.
There are a couple of settings within the web.xml file that I\'d like to get.
However, I
Hmmm... I am assuming that once your web app is up then you are not going to make any change in the web.xml....
Now what you can do is a create a servlet which loads on the startup and initialize a singleton class. You can use the following setting in your web.xml.
XMLStartUp
XMLStartUp
com.test.servlets.XMLStartUp
log4j-init-file
WEB-INF/classes/log4j.properties
0
In tomcat if you set load-on-startup
value 0
, then it means that while loading it has got the highest priority. now in the servlets init
method read all the init-parameters like this and set it in your singleton class.
String dummy= getInitParameter("log4j-init-file");