FreeMarker template error: The following has evaluated to null or missing
生活随笔
收集整理的這篇文章主要介紹了
FreeMarker template error: The following has evaluated to null or missing
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
使用freemarker前端分頁,報(bào)錯(cuò):
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. 引用的值是否正確?
經(jīng)驗(yàn)證都沒有問題。
后面發(fā)現(xiàn)和文件引入的位置有關(guān),pagination.ftl應(yīng)該是宏定義,應(yīng)該放到文件的開頭聲明(目前放到文件的末尾導(dǎo)致)。
?
轉(zhuǎn)載于:https://www.cnblogs.com/davidwang456/p/4792751.html
總結(jié)
以上是生活随笔為你收集整理的FreeMarker template error: The following has evaluated to null or missing的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: hdfs源码分析第二弹
- 下一篇: Java Machine Learnin