請教各位大俠一個JavaBean的問題

kinematic發表於2004-03-28
俺在JSP中呼叫bean,開頭宣告如下
<jsp:useBean id="cart" class="com.wxstudio.test.CartBean" scope="session"/>
<jsp:setProperty name="cart" property="*"/>
後面呼叫一個方法:cart.addItem( id, desc, price, 1);

源程式開頭已宣告package com.wxstudio.test;
並且將編譯好的CartBean.class存在D:\beans\com\wxstudio\test目錄下,然後在
D:\beans下壓縮為CartBean.jar,並且在系統環境變數classpath中也設定了D:\beans\
CartBean.jar,可是執行JSP檔案時報錯:
exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 3 in the jsp file: /bhp/ch21/addCart.jsp

Generated servlet error:
[javac] Compiling 1 source file

D:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\bhp\ch21\addCart_jsp.java:62: cannot resolve symbol
symbol : class CartBean
location: package test
com.wxstudio.test.CartBean cart = null;
^
顯示找不到bean,還請各位大俠救命,小弟叩謝。


相關文章