当前位置: 技术问答>java相关
weblogic的问题,急!!!
来源: 互联网 发布时间:2015-02-04
本文导语: 我有一个购物车的小小jsp程序,这个程序在tomcat下没有任何错误,但是在weblogic下就不能运行,不知道为什么?有没有高手可以解答? 出错提示是找不到CartBean,但我早已把它放在servletclass根目录下.(在tomcat里我是放在class里). ...
我有一个购物车的小小jsp程序,这个程序在tomcat下没有任何错误,但是在weblogic下就不能运行,不知道为什么?有没有高手可以解答?
出错提示是找不到CartBean,但我早已把它放在servletclass根目录下.(在tomcat里我是放在class里).
CartBean程序如下:
import java.util.*;
import java.io.Serializable;
public class CartBean implements java.io.Serializable
{
protected Hashtable itemHashtable = new Hashtable();
public CartBean()
{
}
public void setItemHashtable(Hashtable ht)
{
itemHashtable = ht;
}
public Hashtable getItemHashtable()
{
return itemHashtable;
}
public void addItem(String id, String desc,double price, int qty)
{
String[] item = {id, desc, Double.toString(price),
Integer.toString(qty)};
if (itemHashtable.containsKey(id))
{
String[] workItem = (String[])itemHashtable.get(id);
int workQty = Integer.parseInt(workItem[3]);
qty = qty + workQty;
workItem[3] = Integer.toString(qty);
}
else
itemHashtable.put(id, item);
}
public void removeItem(String id)
{
if (itemHashtable.containsKey(id))
itemHashtable.remove(id);
}
public Enumeration getEnumeration()
{
return itemHashtable.elements();
}
public double getCost()
{
Enumeration enum = itemHashtable.elements();
String[] workItem;
double totalCost = 0.00;
while (enum.hasMoreElements())
{
workItem = (String[])enum.nextElement();
totalCost = totalCost +
(Integer.parseInt(workItem[3]) *
Double.parseDouble(workItem[2]));
}
return totalCost;
}
public int getNumOfItems()
{
Enumeration enum = itemHashtable.elements();
String[] workItem;
int num = 0;
while (enum.hasMoreElements())
{
workItem = (String[])enum.nextElement();
num = num + Integer.parseInt(workItem[3]);
}
return num;
}
}
在另一个人的机器里的weblogic下提示却是CartBean里程序有错.请指教
出错提示是找不到CartBean,但我早已把它放在servletclass根目录下.(在tomcat里我是放在class里).
CartBean程序如下:
import java.util.*;
import java.io.Serializable;
public class CartBean implements java.io.Serializable
{
protected Hashtable itemHashtable = new Hashtable();
public CartBean()
{
}
public void setItemHashtable(Hashtable ht)
{
itemHashtable = ht;
}
public Hashtable getItemHashtable()
{
return itemHashtable;
}
public void addItem(String id, String desc,double price, int qty)
{
String[] item = {id, desc, Double.toString(price),
Integer.toString(qty)};
if (itemHashtable.containsKey(id))
{
String[] workItem = (String[])itemHashtable.get(id);
int workQty = Integer.parseInt(workItem[3]);
qty = qty + workQty;
workItem[3] = Integer.toString(qty);
}
else
itemHashtable.put(id, item);
}
public void removeItem(String id)
{
if (itemHashtable.containsKey(id))
itemHashtable.remove(id);
}
public Enumeration getEnumeration()
{
return itemHashtable.elements();
}
public double getCost()
{
Enumeration enum = itemHashtable.elements();
String[] workItem;
double totalCost = 0.00;
while (enum.hasMoreElements())
{
workItem = (String[])enum.nextElement();
totalCost = totalCost +
(Integer.parseInt(workItem[3]) *
Double.parseDouble(workItem[2]));
}
return totalCost;
}
public int getNumOfItems()
{
Enumeration enum = itemHashtable.elements();
String[] workItem;
int num = 0;
while (enum.hasMoreElements())
{
workItem = (String[])enum.nextElement();
num = num + Integer.parseInt(workItem[3]);
}
return num;
}
}
在另一个人的机器里的weblogic下提示却是CartBean里程序有错.请指教
|
.