Tomcat4.1中的bean,请指教
bean文件存放于D:\tomcat\webapps\test\WEB-INF\classes下,并且编译成功
jsp文件存放于D:\tomcat\webapps\test下
bean:
public class Counter
{
int count = 0;
public Counter()
{
}
public void setCount(int count)
{
this.count=count;
}
public int getCount()
{
count++;
return this.count;
}
}
jsp:
<html>
<head>
<title>简单记数器</title>
</head>
<body>
<jsp:useBean id="name0" scope="application" class="Counter"/>
The Counter is:
<%
out.println(name0.getCount());
%>
<br>
</body>
</html>
非常简单了吧,可是启动tomcat然后运行时候
报错:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] D:\tomcat\work\Standalone\localhost\test\counter_jsp.java:47: cannot resolve symbol
[javac] symbol : class Counter
[javac] location: class org.apache.jsp.counter_jsp
[javac] Counter name0 = null;
[javac] ^
[javac] D:\tomcat\work\Standalone\localhost\test\counter_jsp.java:49: cannot resolve symbol
[javac] symbol : class Counter
[javac] location: class org.apache.jsp.counter_jsp
[javac] name0 = (Counter) pageContext.getAttribute("name0", PageContext.APPLICATION_SCOPE);
[javac] ^
[javac] D:\tomcat\work\Standalone\localhost\test\counter_jsp.java:52: cannot resolve symbol
[javac] symbol : class Counter
[javac] location: class org.apache.jsp.counter_jsp
[javac] name0 = (Counter) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "Counter");
[javac] ^
[javac] 3 errors
请大侠指点,小弟郁闷死了