主题:[讨论]jsp 问题
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.util.*"%>
<HTML>
<HEAD>
<TITLE> 购物商品列表</TITLE>
</HEAD>
<BODY>
<%
String name,count;
request.getSession(true);
Enumeration goods=request.gerParameterNames();
While(goods.hasMoreElements())
{
name=(String)goods.nextElement();
count=request.getParameter(name);
session.putValue(name.count);
}
String names[]=session.getValueNames();
out.print("<font size=5 color=green>商品列表</font><br>");
for(int i=0;i<names.length;i++)
{
out.print(new String(names[i].getBytes("ISO8859_1" ))+":");
out.print(session.getValue(names[i])+"<br>");
}
%>
</BODY>
</HTML>
<%@ page import="java.util.*"%>
<HTML>
<HEAD>
<TITLE> 购物商品列表</TITLE>
</HEAD>
<BODY>
<%
String name,count;
request.getSession(true);
Enumeration goods=request.gerParameterNames();
While(goods.hasMoreElements())
{
name=(String)goods.nextElement();
count=request.getParameter(name);
session.putValue(name.count);
}
String names[]=session.getValueNames();
out.print("<font size=5 color=green>商品列表</font><br>");
for(int i=0;i<names.length;i++)
{
out.print(new String(names[i].getBytes("ISO8859_1" ))+":");
out.print(session.getValue(names[i])+"<br>");
}
%>
</BODY>
</HTML>