Spring模板異常

寫了一個AuthController的接口,執行至方法結束,本以爲成功了,但是Spring卻給了一個模板無法渲染的異常提示。

 template might not exist or might not be accessible by any of the configured Template Resolvers

但是我工程裏面沒有配置過template,所以應該不是tempalte的問題;

後來在controller把@Controller換成@RestController解決;

查了一個兩者的區別:
配置@RestController的作用相當同時配置了@Controller和@ResponseBody兩個註解

後來我將@RestController換成@Controller和@ResponseBody也是沒有問題的。

http://www.cnblogs.com/softidea/p/5884772.html

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