使用 @SpringBootApplication 注释可解决此问题。
@SpringBootApplication@RestControllerpublic class SpringBootLoginController { @RequestMapping("/hello") String hello() { return "Hello World!!!"; } public static void main(String[] args) throws Exception { SpringApplication.run(SpringBootLoginController.class, args); }}或者,通过添加 @EnableAutoConfiguration 也可以解决此问题。
@EnableAutoConfiguration@RestControllerpublic class SpringBootLoginController { @RequestMapping("/hello") String hello() { return "Hello World!!!"; } public static void main(String[] args) throws Exception { SpringApplication.run(SpringBootLoginController.class, args); }}


