Springboot RequestMapping可以查询数据但地址返回404

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Feb 01 22:00:32 CST 2024

There was an unexpected error (type=Not Found, status=404).

出现这个错误在于使用了代码生成器,生成的控制层代码

@Controller

改成

@RestController

就可以获取到@RequestMapping("/user")  地址

你可能感兴趣的:(spring,boot,java,后端)