javax.servlet.ServletException: Cannot expose bind macro helper 'springMacroRequestContext' because of an existing model object of the same name
还有
freemarker.core.NonSequenceOrCollectionException: The value you try to list is an extended_hash+string (com.baomidou.mybatisplus.plugins.Page wrapped into f.e.b.StringModel), thus you must specify two loop variables after the "as"; one for the key, and another for the value, like <#... as k, v>).
项目是springboot+freemark
今天报了这个错 ,先来解释下为什么报错
根据错误提示在[#list indexPage as _data]
遍历集合时候出错了, 再看后台怎么封装的
Page<IrStaticDiss> indexPage = iIrStaticDissService.searchIndexByVo(irStaticDissVo);
model.addAttribute("indexPage", indexPage);
这里是直接将查出Page返回了 (Page是mybatis-plus自带的) , 所以应该再取值时改成下面这样就不会报错了
[#list indexPage.records as _data]
粗心的错…