jsp中javabean的问题

richardcheng
04-02-04 0 107

以下是我的.java file,还有相应的directory
*****************************************
The directory of Apache(V2.0.48) is:
D:\Program Files\Apache Group\Apache2
The directory of Tomcat(V5.0) is:
D:\Program Files\Apache Software Foundation\Tomcat 5.0
Apache and Tomcat are the default directory
*****************************************
The directory of webdoc is:

/--\cgi-bin
/---\jive
E:\websrv\myweb(root)----\jsp\test.jsp /---SimpleBean.java
\---\WEB-INF\classes\hall\SimpleBean.class
*****************************************
Below is my .jsp file(inside \jsp)

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>test Bena</title>
</head>
<body>
<jsp:useBean id="test" class="hall.SimpleBean"/>
<jsp:setProperty name="test"
property="message"
value="Hello WWW" />
</body>
</html>
*******************************************
Below is my .java file(inside \WEB-INF\classes\)
package hall;
public class SimpleBean {
private String message = "No message specified";

public String getMessage() {
return(message);
}

public void setMessage(String message) {
this.message = message;
}
}
*******************************************
下是部份error message
An error occurred at line: 10 in the jsp file: /useBean.jsp

Generated servlet error:
[javac] Compiling 1 source file

D:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\jsp\org\apache\jsp\useBean_jsp.java:42: package hall does not exist
hall.SimpleBean test = null;

请问到底要怎么样设置这个javabena?
thank you very much