private final static String LOG4J_PROPERTIES_LOCATION = "/WEB-INF/log4j.properties";
private String configFilesLocations = "classpath*:spring/applicationContext.xml classpath*:spring/security.xml /WEB-INF/spring/applicationContext.xml";
@Override public void contextInitialized(ServletContextEvent event) {
ServletContext servletContext = event.getServletContext();
initLog4J(servletContext);
String serverInfo = servletContext.getServerInfo();
if (logger.isInfoEnabled()) logger.info("Detected container: " + serverInfo);
serverInfo = serverInfo.toUpperCase();
String server = serverInfo.indexOf("TOMCAT") >= 0 ? "tomcat" : "jetty";
if ((serverInfo.indexOf("SUN JAVA") >= 0) | (serverInfo.indexOf("GLASSFISH") >= 0)) server = "glassfish";
configFilesLocations = configFilesLocations.replace(" ", " classpath*:spring/" + server + ".xml ");