第一個SpringBoot項目填坑

  • 快速搭建SpringBoot

    1. 參考:https://www.cnblogs.com/pengyan-9826/p/8093099.html
  • @GetMapping return “hello” 報"Check your ViewResolver setup!"

    1. 解決 : maven添加 thymeleaf

    2. 參考:https://blog.csdn.net/AV_woaijava/article/details/89336059

  • @GetMapping return new UserBean()報”template might not exist or might not be accessible by any of the configured Template"

    1. 解決:方法返回帶上@ResponseBody或者類註解換成@RestController

    2. 參考:https://blog.csdn.net/liming_0820/article/details/80878168

  • @Data 註解 沒有自己手動生成 get set方法,代碼報錯(可以運行)

    1. 解決:IDEA添加插件”lombok“,同時需要在maven添加lombok依賴

    2. 參考:https://blog.csdn.net/ah_quwei/article/details/84971027

  • @Mapper報錯,java.lang.NoClassDefFoundError:org/apache/ibatis/annotations/Mapper

    1. 解決:mybatis 3.4.0版本以上才支持@Mapper註解(之前的是3.2)

    2. 參考:https://blog.csdn.net/weixin_41010294/article/details/88952335

    發表評論
    所有評論
    還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
    相關文章