使用SpringMVC框架解决中文乱码的问题
2024-10-02 01:36:52
spring Web MVC框架提供了org.springframework.web.filter.CharacterEncodingFilter用于解决POST方式造成的中文乱码
问题。
需要在web.xml中进行如下的配置即可
<!-- POST中文乱码过滤器 -->
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
最新文章
- 通过AF ";get"; 请求html页面总是失败的问题
- apache不断占内存过大,导致虚拟机内存不足,处理方法。
- Incorrect string value异常解决
- MapServer+TileCache+Apache+Python24 构建KS数据服务器
- 含有Date和Timestamp的Java和Json互相转化
- thinkPHP开发基础知识 包括变量神马的
- Apache Options Indexes FollowSymLinks具体解释
- Python Fabric远程自动部署简介
- java对象与Json字符串之间的转化(fastjson)
- 痞子衡嵌入式:第一本Git命令教程(0)- 索引
- websocket ----简介,以及demo
- crontab不能执行sudo:抱歉,您必须拥有一个终端来执行 sudo
- MySQL数据库查询操作进阶——多表查询
- openVPN设置本地密码验证
- 铺音out1
- win2003 server的域用户加入本地管理员组
- OA系统权限管理设计方案
- js中的颜色对应的常量代码code
- 我的BootStrap学习笔记
- aes并发加密Cipher not initialized 异常
热门文章
- TensorFlow 实战(一)—— 交叉熵(cross entropy)的定义
- spring定时任务.线程池,自定义多线程配置
- C#中的yield关键字
- Java中的集合Map、HashMap、Hashtable、Properties、SortedMap、TreeMap、WeakHashMap、IdentityHashMap、EnumMap(五)
- Win7使用初体验
- python 和为S的两个数字
- Mac版Visual Studio预览版
- SecureCRT循环检查设备状态
- Effective JavaScript Item 38 调用父类的构造函数在子类的构造函数
- 期刊(Journal)、会议(Conference)及其影响因子(Impact Factor)