Examples of ServletContext


Examples of javax.servlet.ServletContext

    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 ");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.