关于JavaBean 的问题,大家帮帮我吧!
我在D:\TEST下面建立了虚拟目录"test"
然后我在d:\test下面建立了web-inf/classes文件夹.
又在CLASSPATH值中添加了"d:\test\web-inf\classes;"
如果不使用BEAN的时候JSP页面可以正常显示.但是使用了bean就不行了.
我在test目录下建立了test.jsp文件,内容如下:
<jsp:useBean id="test" class="mybean.testt" scope="session"/>
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<%=test.show("ceshi")%>
<body>
</body>
</html>
然后在建立了test.java内容如下:
package mybean;
public class test
{
public String show(String text)
{
return text;
}
}
将生成的test.class文件放到了web-inf\classes\mybean\目录下.
然后执行test.jsp出现了下面的错误提示:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /test.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\test\org\apache\jsp\test_jsp.java:40: package mybean does not exist
mybean.testt test = null;
请问各位大虾,这是怎么回事呢?