用tomcat的书店购物车始终有错误解决不了

来源:百度知道 编辑:UC知道 时间:2024/06/18 01:36:20
HTTP Status 500 -
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP:
JSP FileName:/cart_see.jsp
Java FileName:/E:/JDBC/apache-tomcat-5.5.25/work/Catalina/localhost/WebModuleDefault//org/apache/jsp\cart_005fsee_jsp.java

An error occurred at line: 89 in the jsp file: /cart_see.jsp
cart cannot be resolved
86: float sum=0;
87: int ID=-1;
88: String goodsname="";
89: for(int i=0;i<cart.size();i++){
90: goodselement goodsitem=(goodselement)cart.elementAt(i);
91: sum=sum+goodsitem.number*goodsitem.nowprice;
92: ID=goodsitem.ID;

JSP FileName:/cart_see.jsp
Java FileName:/E:/JDBC/apache-tomcat-5.5.25/work/Catalina/localhost/WebModuleDefault//org/apache/jsp\cart_005fsee_jsp

你最好把 cart_see.jsp 的源码帖出来。
这个问题因为你前面声明数据库连接的那个变量:conn 没有声明或者没有初始化,修改一下jsp就好了。

没有找到 cart 这个属性 注意jsp接值时候有没有接受 cart 这个对象

hiofsdg9565588888888888888888888888888888888888888888888