jsp中javabean的問題

richardcheng發表於2004-02-04
以下是我的.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

相關文章