<%@ page contentType="text/html; charset=GBK" %>
<%@page import="java.net.*" %>
<html>
<head>
<title>
input
</title>
</head>
<body bgcolor="#ffffff">
<%
String name = "我是一个兵";
//此处和得到的两个地方都是GBK也可以,只要相同
name = URLEncoder.encode(name,"UTF-8");
%>
<a href="output.jsp?name=<%=name%>">我是一个兵</a>
</body>
</html>
=======================================================
<%@page contentType="text/html; charset=GBK"%>
<html>
<head>
<title>output</title>
</head>
<body bgcolor="#ffffff">
<%
String name = request.getParameter("name");
name = new String(name.getBytes("ISO-8859-1"), "UTF-8");
%>
<h1><%=name%> </h1>
</body>
</html>