shokey520
发贴: 8
|
于 2006-11-23 21:50
正在学习JSP,使用了一个Filter进行统一中文编码,Filter名为econding。在web.xml中配置如下: <filter> <filter-name>encoding</filter-name> <filter-class>com.demo.filter.EncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>GBK</param-value> </init-param> </filter> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>/test/*</url-pattern> </filter-mapping> 但是当我在浏览器中键入http://127.0.0.1:8080/test/index.jsp时,这个页面中的中文还是乱码。 而且我在Filter的doFilter方法中加入System.out.println("请求编码");Tomcat控制台没有任何输出。 我被这个搞郁闷两天了,请高手指点一下。
|