tomcat 中文问题
hh23 2001-07-03 12:12:34 环境是:
Redhat7.0 apache1.3.14 tomcat 3.1.1 jdk 1.3.1
1) index.jsp
<html>
<head>
<title>
test1
</title>
<head>
<body>
<%@ page contentType="text/html;charset=GBK" %>
<% String str="中文"; %>
<% byte[] by= str.getBytes("GBK");%>
<% String s= new String(by);%>
<a href="test.jsp?name=<%=str%>
">测试jsp的中文</a>
</body>
</html>
2)test.jsp
<%!String name;%>
<%
name=request.getParameter("name");
out.println(name);
%>
<%
if (name==null)
out.print("nothing");
else out.print(name);
%>
<%
out.println("汉字");
%>
结果test.jsp显示:
汉字
为什么URL中的汉字不显示?