jsp乱码

FieldSet.html

<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<body>
<form name=form1 action="FormData.jsp" method="post">
<fieldset>
<input type=checkbox name=box1 checked OnClick="document.form1.text1.value='box1';">box1为默认值<br>
<input type=checkbox name=box2 OnClick="document.form1.text1.value='box2';">box2<br>
<input type=checkbox name=box3 disable>box3并无确认功能<br>
<input type=text name=text1 value=""><br>
</fieldset>
<input type=submit name=submit value="确实">
</form>
</body>
</html>

FormData.jsp

<html>
<%@ page contentType="text/html; charset=gb2312" %>
<body>
<%java.util.Enumeration e=request.getParameterNames();%>
<table border="1">
<tr><th>name</th><th>value</th></tr>
<%while(e.hasMoreElements())
 {
 String name=(String) e.nextElement();
 String aa=new String(request.getParameter(name).getBytes("ISO8859_1"),"GBK"); 
 out.println("<tr><td>"+name+"</td>"); 
 out.println("<td>"+aa+"</td></tr>");
 }
%>
</table>
</body>
</html> 

你可能感兴趣的:(html,jsp,String,input,action,border)