1.普通頁面中文亂碼問題html
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" %>java
<%
request.setCharacterEncoding("utf-8");
%>jsp
2.URL傳參出現中文亂碼 解決方法:server
<a href="request.jsp?username=中文">中文傳參連接</a>xml
更改Tomcat根目錄conf下配置文件server.xmlhtm
.............................................................................................utf-8
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="utf-8"/>io
.............................................................................................import