This commit is contained in:
Phillip Webb
2014-06-18 16:30:22 -07:00
parent 46c46dbd0c
commit a2efe17fc9
2 changed files with 7 additions and 4 deletions

View File

@@ -34,13 +34,10 @@ public class SampleTomcatApplication {
private static Log logger = LogFactory.getLog(SampleTomcatApplication.class);
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleTomcatApplication.class, args);
}
@Bean
protected ServletContextListener listener() {
return new ServletContextListener() {
@Override
public void contextInitialized(ServletContextEvent sce) {
logger.info("ServletContext initialized");
@@ -50,7 +47,12 @@ public class SampleTomcatApplication {
public void contextDestroyed(ServletContextEvent sce) {
logger.info("ServletContext destroyed");
}
};
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleTomcatApplication.class, args);
}
}

View File

@@ -34,4 +34,5 @@ public class SampleController {
public String helloWorld() {
return this.helloWorldService.getHelloMessage();
}
}