Post Chinese garbled solution method
Set when data is accepted
Request.setcharacterencoding ("Utf-8");//The encoding must be consistent with the page encoding
Page Setup
<% @page import= "Java.net.URLDecoder"%>
<% @page import= "Org.apache.naming.java.javaURLContextFactory"%>
<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "pageencoding=" UTF-8 "%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
Get Chinese garbled
Modify Tomcat Server.xml
Add uriencoding= "utf-8" setting encoding
<connector uriencoding= "Utf-8" connectiontimeout= "20000" port= "8080" protocol= "http/1.1" redirectport= "8443"/ >
Instance:
<a href= "ppsd.jsp?a= plate two" >654465465654</a>
The Servlet background jump page URL has Chinese
Response.sendredirect ("ppsd.jsp?a=46565464564" +urlencoder.encode ("Aston release", "Utf-8") + "99999");
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Java page Transfer Chinese garbled solution