您的Controller和SpringBoot应用程序看起来还不错。尝试清理并构建您的项目。当您运行DemoApplication时,您应该在控制台中看到以下内容
Mapped "{[/greeting]}" onto public java.lang.String com.example.controller.GifController.sayhello()在您的DemoApplication中,您只需要@SpringBootApplication,因为此注释等效于使用@ Configuration,@
EnableAutoConfiguration和@ComponentScan



