spring Web MVC框架提供了org.springframework.web.filter.CharacterEncodingFilter用于解决POST方式造成的中文乱码

问题。

需要在web.xml中进行如下的配置即可


  1. <!-- POST中文乱码过滤器 -->
  2. <filter>
  3. <filter-name>CharacterEncodingFilter</filter-name>
  4. <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  5. <init-param>
  6. <param-name>encoding</param-name>
  7. <param-value>utf-8</param-value>
  8. </init-param>
  9. </filter>
  10. <filter-mapping>
  11. <filter-name>CharacterEncodingFilter</filter-name>
  12. <url-pattern>/*</url-pattern>
  13. </filter-mapping>



 

最新文章

  1. 通过AF &quot;get&quot; 请求html页面总是失败的问题
  2. apache不断占内存过大,导致虚拟机内存不足,处理方法。
  3. Incorrect string value异常解决
  4. MapServer+TileCache+Apache+Python24 构建KS数据服务器
  5. 含有Date和Timestamp的Java和Json互相转化
  6. thinkPHP开发基础知识 包括变量神马的
  7. Apache Options Indexes FollowSymLinks具体解释
  8. Python Fabric远程自动部署简介
  9. java对象与Json字符串之间的转化(fastjson)
  10. 痞子衡嵌入式:第一本Git命令教程(0)- 索引
  11. websocket ----简介,以及demo
  12. crontab不能执行sudo:抱歉,您必须拥有一个终端来执行 sudo
  13. MySQL数据库查询操作进阶——多表查询
  14. openVPN设置本地密码验证
  15. 铺音out1
  16. win2003 server的域用户加入本地管理员组
  17. OA系统权限管理设计方案
  18. js中的颜色对应的常量代码code
  19. 我的BootStrap学习笔记
  20. aes并发加密Cipher not initialized 异常

热门文章

  1. TensorFlow 实战(一)—— 交叉熵(cross entropy)的定义
  2. spring定时任务.线程池,自定义多线程配置
  3. C#中的yield关键字
  4. Java中的集合Map、HashMap、Hashtable、Properties、SortedMap、TreeMap、WeakHashMap、IdentityHashMap、EnumMap(五)
  5. Win7使用初体验
  6. python 和为S的两个数字
  7. Mac版Visual Studio预览版
  8. SecureCRT循环检查设备状态
  9. Effective JavaScript Item 38 调用父类的构造函数在子类的构造函数
  10. 期刊(Journal)、会议(Conference)及其影响因子(Impact Factor)