package com.changhong.autoformtest;
|
|
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
import org.springframework.boot.web.support.SpringBootServletInitializer;
|
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.annotation.ComponentScan;
|
|
|
@SpringBootApplication
|
@ComponentScan(basePackages={"com.changhong.autoform","com.changhong.autoformtest"})
|
public class Application extends SpringBootServletInitializer{
|
|
private static ApplicationContext applicationContext = null;
|
|
public static void main(String[] args) throws Exception {
|
applicationContext = SpringApplication.run(Application.class, args);
|
}
|
|
// 获取applicationContext
|
public static ApplicationContext getApplicationContext() {
|
return applicationContext;
|
}
|
|
@Override
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
return builder.sources(Application.class);
|
}
|
}
|