/** * The servlet container is starting. * <p> * Initialise the properties file using SystemProperties.initWebapp(); * and start Ebean. * </p> */ public void contextInitialized(ServletContextEvent event) { try { ServletContext servletContext = event.getServletContext(); GlobalProperties.setServletContext(servletContext); if (servletContext != null) { String servletRealPath = servletContext.getRealPath(""); GlobalProperties.put("servlet.realpath", servletRealPath); logger.info("servlet.realpath=[" + servletRealPath + "]"); } Ebean.getServer(null); } catch (Exception ex) { ex.printStackTrace(); } }
/** * The servlet container is starting. * <p> * Initialise the properties file using SystemProperties.initWebapp(); * and start Ebean. * </p> */ public void contextInitialized(ServletContextEvent event) { try { ServletContext servletContext = event.getServletContext(); GlobalProperties.setServletContext(servletContext); if (servletContext != null) { String servletRealPath = servletContext.getRealPath(""); GlobalProperties.put("servlet.realpath", servletRealPath); logger.info("servlet.realpath=[" + servletRealPath + "]"); } Ebean.getServer(null); } catch (Exception ex) { ex.printStackTrace(); } }