表单提交出现乱码!
<%@ page language="java" %>
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>选择物品的页面</title>
</head>
<body bgcolor="#FFFFFF">
<jsp:useBean id="buy" class="gwpack.Buy" scope="session">
</jsp:useBean>
<center>
<P>选择您要购买的商品添加到购物车:
<%String str=response.encodeRedirectUrl("add.jsp"); %>
<form action="<%=str%>" method=post name=form>
<select name="item" value=" 没选择">
<option value="TV"> 电视机
<option value="apple"> 苹果
<option value="rom"> JSP教程
<option value="phone"> 手机
<option value="tea"> 茶叶
</option>
</select>
<P>输入购买的数量:
<Input type=t"text" name="mount">
<P>选择计量单位:
<INPUT type="radio" name="unit" value="个">个
<INPUT type="radio" name="unit" value="公斤">公斤
<INPUT type="radio" name="unit" value="台">台
<INPUT type="radio" name="unit" value="瓶">瓶 <br>
<input type="submit" value="提交"></input>
</form>
<P>您的购物车有如下商品:
<% Hashtable list=buy.show();
Enumeration enum=list.elements();
while(enum.hasMoreElements()){
String goods=(String)enum.nextElement();
byte b[]=goods.getBytes("ISO-8859-1");
// goods=new String(goods.getBytes("ISO-8859-1"),UTF-8);
out.print("<BR>"+goods);
}
%>
<%String str1=response.encodeRedirectUrl("select.jsp"); %>
<FORM action="<%=str1%>" method=post name=form>
<Input type=submit value="修改购物车中的货物">
</FORM>
</center>
</body>
</html>
<P>您的购物车有如下商品:
<% Hashtable list=buy.show();
Enumeration enum=list.elements();
while(enum.hasMoreElements()){
String goods=(String)enum.nextElement();
byte b[]=goods.getBytes("ISO-8859-1");
// goods=new String(goods.getBytes("ISO-8859-1"),UTF-8);
out.print("<BR>"+goods);
}
%>
执行这里出现乱码!
怎么解决?