jsp乱码问题,请教各位了
c.jsp:
<%@ page contentType="text/html;charset=GBK" %>
<html>
<body>
<%
request.setCharacterEncoding("gb2312");
%>
<form action="d.jsp" method="post">
姓名<input type="text" name="UserName">
<input type="submit" value="提交">
</form>
</body>
</html>
d.jsp:
<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*"%>
<html>
<body>
你好!
<%
request.setCharacterEncoding("UTF-8");
String Name=request.getParameter("UserName");
System.out.println("Name:"+Name);
%>
今天是
<%
Date today=new Date();
%>
<%=today.getDate()%>号,星期<%=today.getDay()%>
</body>
</html>
打印出的Name是乱码,怎么回事?