In this paper, an example is given to show how to solve the problem of disorderly code in Chinese parameters of hyperlink transfer in JSP pages. To share with you for your reference, as follows:
This paper analyzes how to solve the problem of garbled code in the receiving page.
You can do the following in the accept page,
Note that new string () is used to create a new string
<html> <head> < title > Page 1 < / Title > </head> <body> < a href = "2. JSP? Name = Zhang San & password = 123456" > pay attention here</a> </body> </html>
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%> <html> <head> < title > page 2 < / Title > </head> <body> <%=new String(request.getParameter("name").getBytes("ISO-8859-1")) %> && <%=request.getParameter("password") %> </body> </html>
I hope this article is helpful for JSP programming.