81,091
社区成员
发帖
与我相关
我的任务
分享
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'three.jsp' starting page</title>
</head>
<%!
public String getString(String s){
if(s==null){
s="";
}
try{
byte b[] = s.getBytes("ISO-8859-1");
s = new String(b);
}catch(Exception e){}
return s;
}
%>
<body>
<p>这里是结账处:</p>
<%
String ss = request.getParameter("buy");
session.setAttribute("goods",ss);
String s1 = (String)session.getAttribute("custom");
String s2 = (String)session.getAttribute("name");
String s3 = (String)session.getAttribute("goods");
s2 = getString(s2);
s3 = getString(s3);
%>
<p><%=s1 %>的姓名是:</p>
<%=s2 %>
<p>购买的商品是:</p>
<%=s3 %>
</body>
</html>