解決Error resolving template ''/emp/add" template might not exist or might not be accessible by...

異常關鍵內容:

Error resolving template ‘’/emp/add" template might not exist or might not be accessible by any of the configured Template Resolvers。
具體截圖如下:
在這裏插入圖片描述

場景:

  1. 本地運行項目能訪問相關頁面,服務器在運行jar就出問題。
  2. 經過度娘與調試分析,原來是springboot+themeleaf框架,返回頁面不能多出“/”。
    在此,做出記錄總結。

解決如下:

去掉返回視圖路徑的 “/”,具體截圖如下:
錯誤:
在這裏插入圖片描述
正確:
在這裏插入圖片描述

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