There are href values in the a.jsp.
<a href=\ "6.jsp?param=" +rs.getstring (2) + "\" > "
Use in b.jsp
<% request.setcharacterencoding ("Utf-8");%>
<%=request.getparameter ("param")%>
Get value, run debug find is a bunch of garbled
At first I thought it was the JSP overall encoding method is not correct, so the following changes:
Change the beginning of the b.jsp to
<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "
pageencoding= "Utf-8"%>
Insert <meta http-equiv= "Content-type" content= "text/html in front of title; Charset=utf-8 ">
Then run the debug
Find it or
I have added a few Chinese output in HTML, run debugging found that the Chinese can be very good output only the value of the parameter is garbled
This is not a JSP overall encoding format problem, but b.jsp when the value is not read in the wrong format, so I made the following changes:
<% request.setcharacterencoding ("Utf-8");%>
<%string name=new String (request.getparameter ("param"). GetBytes ("Iso-8859-1"), "Utf-8");
OUT.PRINTLN (name); %>
Run debug Discovery to display Chinese very well
About the href parameter between JSP (Chinese) garbled problem