FreeMarker template error: The following has evaluated to null or missing
生活随笔
收集整理的這篇文章主要介紹了
FreeMarker template error: The following has evaluated to null or missing
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
使用freemarker前端分頁,報錯:
FreeMarker template error: The following has evaluated to null or missing
后端直接賦值:
List<Student> stu=new ArrayList<Student>();Student s1=null;for(int i=1;i<46;i++){s1=new Student();s1.setAge(i+10);s1.setId(i+"100");s1.setName("ww"+i);stu.add(s1);} Page<Student > page = new PageImpl(stu,pageable,45);model.addAttribute("content", page);return new ModelAndView("/Page1",model);分析可能原因:
1. Student列表中的對象的getter method不是public?
2. student類是否public類?
3. 引用的值是否正確?
經驗證都沒有問題。
后面發現和文件引入的位置有關,pagination.ftl應該是宏定義,應該放到文件的開頭聲明(目前放到文件的末尾導致)。
?
轉載于:https://www.cnblogs.com/davidwang456/p/4792751.html
總結
以上是生活随笔為你收集整理的FreeMarker template error: The following has evaluated to null or missing的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: hdfs源码分析第二弹
- 下一篇: Java Machine Learnin