我用JBuilderX建的javabean,JSP不能调用!@#@¥#%^&#在线等!!!!
hiw 2004-08-05 09:10:16 usercount.jsp:
-------------------
<jsp:useBean id="counter" scope="application" class="test.Counter"/>
<br>
你是第:
<%
out.println(counter.getCount());
counter.addCount();
%>位人
------------------------
Counter.java
------------------------
package test;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class Counter {
int Count = 1;
public void Counter() {
}
public void addCount()
{
Count++;
}
public int getCount()
{
return Count;
}
}
---------------------------
用JB建的Javabean工程生成Counter.class后,放到WEB-INF\class\test目录下,但是就是不能用,出现下面错误:
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: /firstjsp/usercount.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\jsp-examples\org\apache\jsp\firstjsp\usercount_jsp.java:40: package test does not exist
test.Counter counter = null;
^
An error occurred at line: 1 in the jsp file: /firstjsp/usercount.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\jsp-examples\org\apache\jsp\firstjsp\usercount_jsp.java:42: package test does not exist
counter = (test.Counter) pageContext.getAttribute("counter", PageContext.APPLICATION_SCOPE);
^
An error occurred at line: 1 in the jsp file: /firstjsp/usercount.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\jsp-examples\org\apache\jsp\firstjsp\usercount_jsp.java:44: package test does not exist
counter = new test.Counter();
^
3 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.
大家知道的,帮忙啊,在线急急等