日期:2014-05-19 浏览次数:20648 次
a)Tomcat:修改Tomcat安装目录下conf/server.xml文件,加上URIEncoding="UTF-8"/ <Connector port="8080" .... URIEncoding="UTF-8"/> b)JBOSS :安装目录下 server/default/deploy/jbossweb-tomcat55.sar/server.xml <Connector port="8080" .... URIEncoding="UTF-8"/>
<filter> <filter-name>Set Character Encoding</filter-name> <filter-class>SetCharacterEncodingFilter.java 的类路径</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>Set Character Encoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
<%@ page language="java" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv=content-type content="text/html; charset=UTF-8"> <title> </title> </head> <body> </body> </html>