web.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
init-param>
<param-name>encoding</param-name>
<param-value>GB2312</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<!-- 要过滤得类型 -->
<filter-mapping>
<filter-name>SetCharacterEncoding</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
</web-app>
public class CharacterEncodingFilter
extends OncePerRequestFilter
Servlet 2.3/2.4 Filter that allows one to specify a character
encoding for requests. This is useful because current browsers
typically do not set a character encoding even if specified in the HTML
page or form.
This filter can either apply its encoding if the request does not
already specify an encoding, or enforce this filter's encoding in any
case ("forceEncoding"="true"). In the latter case, the encoding will
also be applied as default response encoding on Servlet 2.4+ containers
(although this will usually be overridden by a full content type set in
the view).
分享到:
相关推荐
org.springframework.web.filter.CharacterEncodingFilter.class org.springframework.web.filter.CommonsRequestLoggingFilter.class org.springframework.web.filter.DelegatingFilterProxy.class org.spring...
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java...
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java...
严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener at ...
org.springframework.web.filter.CharacterEncodingFilter </filter-class> <param-name>encoding <param-value>UTF-8 </filter> <filter-mapping> <filter-name>setCharacterEncoding</filter-name> ...
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <param-name>encoding <param-value>UTF-8 <param-name>forceEncoding <param-value>true </filter> <filter...
cannot be cast to javax.servlet.Filter 报错, 原因servlet-api.jar冲突 使用maven开发web应用程序, 启动的时候报错: jar not loaded....java.lang.ClassCastException: org.springframework.web.f
DOS命令使用方法(超全). ... xmlns:xsi=... <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <param-name>encoding <param-value>UTF-8</param-value>
org.springframework.web.filter.CharacterEncodingFilter </filter-class> <param-name>encoding <param-value>UTF-8 </filter> <filter-mapping> <filter-name>encodingFilter</filter-name...
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <param-name>encoding <param-value>UTF-8 <param-name>forceEncoding <param-value>true </...
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <param-name>encoding <param-value>UTF-8 <param-name>forceEncoding <param-value>true </...
22 <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> 23 24 <param-name>encoding 25 <param-value>UTF-8 26 27 </filter> 28 29 <filter-mapping> 30 <filter-name>...
解决警告:log4j:WARN No appenders could be found for logger (org.springframework.web.filter.CharacterEncodingFilter).
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>GBK</param-value> </init-param> ...
需要指定的是Spring 1.2.5提供了两套Hibernate的支持包,其中Hibernate 2相关的封装类位于org.springframework.orm.hibernate2.*包中,而Hibernate 3.0的封装类位于org.springframework.orm.hibernate3.*包中,...
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <param-name>encoding <param-value>UTF-8 </filter> <filter-mapping> <filter-name>encodingFilter</filter-...
org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>GBK</param-value> </init-param> <init-param> <param-name>...
-- 中文过滤器start --> <filter> <filter-name>Encoding</filter-name> <filter-class> org.springframework.web.filter.CharacterEncodingFilter </filter-class> <init-param><br>...
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <param-name>encoding <param-value>UTF-8 <param-name>forceEncoding <param-value>true </filter> <filter...
这篇文章主要介绍了JQuery发送ajax请求时中文乱码问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有... <filter>org.springframework.web.filter.CharacterEncodingFilter</filter> <param>enc