1 入口类RenrenApplication继承SpringBootServletInitializer
@SpringBootApplicationpublic class RenrenApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(RenrenApplication.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(RenrenApplication.class); } }复制代码
注解:
//作用域,在方法上@Target(ElementType.METHOD)//定义注解在JVM运行时保留@Retention(RetentionPolicy.RUNTIME)//代表会被javadoc记录@Documented//定义成Service类@Service复制代码