开发者社区> 问答> 正文

springmvc+freemarker问题

我用springmvc+freemarker开发一个项目,springmvc中配置了

这条,

现在页面上${rc}取出的是RequestContext对象,也就是说这个对象不能操作cookie!

我试过了${rc.getCookies()}、${request.getCookies()}、${Request["request"].getCookies()}都取不出来。

归根究底我觉得是页面上取不出来HttpServletRequest对象!

请问怎么解决?

展开
收起
a123456678 2016-03-17 10:01:53 2152 0
1 条回答
写回答
取消 提交回答
  • 在controller中的方法model.addAttribute("request",request);

    然后在freemarker中能操作request对象里面的内容

    2019-07-17 19:04:34
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关课程

更多

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载