按照文档配置后,在controller里面写方法,使用了@RestController注解,但是一直报错如下:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback. Wed Dec 14 16:35:25 CST 2016 There was an unexpected error (type=Not Found, status=404). No message available |
后面发展问题,启动类SpringbootfirstApplication需要放在所有包的外面,问题解决.
比如说,你建立了很多包,com.yh.controller,com.yh.service,com.yh.entity等等,而启动文件放在com.yh包下,问题解决.