spring web.xml编码格式配置
2012-12-27 16:00
344 查看
<!-- 设置servlet编码开始 --> <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> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>CharacterEncodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 设置servlet编码结束 -->
<filter-mapping> <filter-name>CharacterEncodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
这里为所有,但是也可以配置如下,多个
<filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping>
相关文章推荐
- 在Web.xml 内配置浏览器解析html的编码格式
- 在web.xml中通过contextConfigLocation配置spring
- web.xml中配置spring的几种方式 以及 Spring获取Bean的几种方式
- Spring配置web.xml的<servlet>标签
- SPRINGMYBATIS01 Unit03: Spring Web MVC简介 、 基于XML配置的MVC应用 、 基于注解配置的MVC应用
- web.xml中配置spring自带字符集filter
- Spring 纯java配置 让spring mvc 生效的 web.xml 配置
- spring与struts2 mvc共存web.xml简单配置
- 解析通过web.xml文件控制利用过滤器实现编码格式步骤
- web.xml 中spring-servlet.xml 和 application.xml 配置规则
- web.xml 中spring-servlet.xml 和 application.xml 配置位置及含义
- Spring --web工程下xml配置文件部署
- 精spring环境(web。xml)配置详解 http://www.cnblogs.com/yaohong/p/5905750.html
- spring通过在web.xml 中配置ContextLoaderListener 来加载co...
- 力所能及之spring web.xml配置
- webwork 配置文件 web.xml通用格式
- 在web.xml中配置,使用配置类替代springmvc.xml和applicationContext.xml
- ssm项目之web.xml,spring,springmvc,mybatis配置
- spring在web.xml中的配置
- 备份 - web.xml 中spring-servlet.xml 和 application.xml 配置位置及含义