现在的位置: 首页 > 综合 > 正文

springmvc+freemarker的简单demo

2017年10月28日 ⁄ 综合 ⁄ 共 388字 ⁄ 字号 评论关闭

原文:springmvc+freemarker的简单demo

源代码下载地址:http://www.zuidaima.com/share/1550463645682688.htm

简单演示如果在springmvc中通过ModelMap添加Map,List,Entity,Request参数,其中包括中文参数乱码的处理,暂时解决方案是 new String(a.getBytes("iso8859-1"), "utf-8") 有更好的方案大家可以提供下。

另外还有最新版本支持直接获取通过spring wrap 的java servlet的Request对象,通过设置:

<property name="exposeRequestAttributes" value="true" />

即可。

访问:http://localhost/index.htm?a=%E4%B8%AD%E6%96%87 可以看到效果。

抱歉!评论已关闭.