<%@page contentType="text/html; charset=GBK"%>
<%@page import="org.qhit.netshop.beans.Goods,java.util.Map,java.util.HashMap"%>
<html>
<head>
<title>buylist</title>
<script type="text/javascript" language="javascript">
function toEditBuyList(){
document.all["status"].value="editbuylist";
}
function toConfirm(){
document.all["status"].value="confirm";
}
</script>
</head>
<body bgcolor="#67999A">
<center>
<p>
<font color="white">
<b>以下是您所选购的物品清单</b>
</font>
</p>
<br/>
<%
Map<String, Goods> goods = (HashMap) session.getAttribute("buylist");
int count = goods.size();
%>
<form action="confirmservlet" method="POST">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<th width="15%" bgcolor="#67999A">
<font color="white">产品编号</font>
</th>
<th width="45%" bgcolor="#67999A">
<font color="white">产品名称</font>
</th>
<th width="15%" bgcolor="#67999A">
<font color="white">产品数量</font>
</th>
<th width="10%" bgcolor="#67999A">
<font color="white">购买</font>
</th>
<th width="15%" bgcolor="#67999A">
<font color="white">总价</font>
</th>
</tr>
</table>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<%
float sum = 0;
for (int i = 0; i < count; i++) {
%>
<tr>
<td align="center" width="15%" bgcolor="#67999A"><%=goods.get(i).getPid() %> </td>
<td align="center" width="45%" bgcolor="#67999A"><%=goods.get(i).getPname() %> </td>
<td align="center" width="15%" bgcolor="#67999A">
<input type="text" name="<%=goods.get(i).getPid()%>" value="<%=goods.get(i).getBuyNumber()%>" size="5"/>
</td>
<td align="center" width="10%" bgcolor="#67999A">
<input type="checkbox" name="shopStatus" value="<%=goods.get(i).getPid()%>" checked="checked"/>
</td>
<td align="center" width="15%" bgcolor="#67999A"><%=goods.get(i).getPrice()%> </td>
</tr>
<%
sum += goods.get(i).getPrice();
}
%>
</table>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#67999A" align="right">
<font color="red">
<b> 总价格:
<%=sum %> </b>
</font>
</td>
</tr>
</table>
<br/>
<br/>
<input type="hidden" name="status" id="status"/>
<input type="submit" value="确认更改" onclick="toEditBuyList()"/>
<input type="button" value="继续购物" onclick="location='index.jsp'"/>
<input type="submit" value="去收银台" onclick="toConfirm()"/>
</form>
</center>
</body>
</html>
<%@page import="org.qhit.netshop.beans.Goods,java.util.Map,java.util.HashMap"%>
<html>
<head>
<title>buylist</title>
<script type="text/javascript" language="javascript">
function toEditBuyList(){
document.all["status"].value="editbuylist";
}
function toConfirm(){
document.all["status"].value="confirm";
}
</script>
</head>
<body bgcolor="#67999A">
<center>
<p>
<font color="white">
<b>以下是您所选购的物品清单</b>
</font>
</p>
<br/>
<%
Map<String, Goods> goods = (HashMap) session.getAttribute("buylist");
int count = goods.size();
%>
<form action="confirmservlet" method="POST">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<th width="15%" bgcolor="#67999A">
<font color="white">产品编号</font>
</th>
<th width="45%" bgcolor="#67999A">
<font color="white">产品名称</font>
</th>
<th width="15%" bgcolor="#67999A">
<font color="white">产品数量</font>
</th>
<th width="10%" bgcolor="#67999A">
<font color="white">购买</font>
</th>
<th width="15%" bgcolor="#67999A">
<font color="white">总价</font>
</th>
</tr>
</table>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<%
float sum = 0;
for (int i = 0; i < count; i++) {
%>
<tr>
<td align="center" width="15%" bgcolor="#67999A"><%=goods.get(i).getPid() %> </td>
<td align="center" width="45%" bgcolor="#67999A"><%=goods.get(i).getPname() %> </td>
<td align="center" width="15%" bgcolor="#67999A">
<input type="text" name="<%=goods.get(i).getPid()%>" value="<%=goods.get(i).getBuyNumber()%>" size="5"/>
</td>
<td align="center" width="10%" bgcolor="#67999A">
<input type="checkbox" name="shopStatus" value="<%=goods.get(i).getPid()%>" checked="checked"/>
</td>
<td align="center" width="15%" bgcolor="#67999A"><%=goods.get(i).getPrice()%> </td>
</tr>
<%
sum += goods.get(i).getPrice();
}
%>
</table>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#67999A" align="right">
<font color="red">
<b> 总价格:
<%=sum %> </b>
</font>
</td>
</tr>
</table>
<br/>
<br/>
<input type="hidden" name="status" id="status"/>
<input type="submit" value="确认更改" onclick="toEditBuyList()"/>
<input type="button" value="继续购物" onclick="location='index.jsp'"/>
<input type="submit" value="去收银台" onclick="toConfirm()"/>
</form>
</center>
</body>
</html>
解决方案 »
- response.write(session.getAttribute("BranchName")提示错误!
- web中实现文件上传出错
- 控制页面的大小
- 谁有用jsp写的防注入的代码?我从网上找的为什么不行?
- STRUTS与AJAX结合的问题
- quartz 如何在配置文件中配置任务执行时间段!
- jsf的action之间如何传值?
- 问个简单的jstl问题 希望大家帮忙
- 用js实现把一组同名复选框中已经选中的复选框的value值都加入到一个树组中!
- 请问一个关于操作客户端的问题,请问我怎么判断一个客户端的软件安装信息是否已经写入注册表
- excel读取数据的问题
- SQL语句该怎么写,如何让当前系统时间减三天
2008-4-25 11:25:38 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet debugjsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 23 in the jsp file: /buylist.jsp
Generated servlet error:
Syntax error on token "<", ( expectedAn error occurred at line: 23 in the jsp file: /buylist.jsp
Generated servlet error:
Syntax error, insert ")" to complete Expression
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
这地方出错好象。。
Map<String, Goods> goods = (HashMap) session.getAttribute("buylist");
改成
Map<String, Goods> goods = (Map<String, Goods> ) session.getAttribute("buylist");