日期:2014-05-17 浏览次数:20633 次
package dbPool;
public class dbPool {
public void test() {
System.out.print("this is datapool");
}
}
<%@page contentType="text/html; charset=GBK"%>
<%@page import="java.util.*" %>
<%@page import="dbPool.dbPool" %>
<%
out.print("Today is "+new java.util.Date());
dbPool tmp = new dbPool();
tmp.test();
%>
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
C:\WATMServer\Tomcat5\work\Catalina\localhost\_\org\apache\jsp\index_jsp.java:9: package dbPool does not exist
import dbPool.*;
^
An error occurred at line: 7 in the jsp file: /index.jsp
Generated servlet error:
C:\WATMServer\Tomcat5\work\Catalina\localhost\_\org\apache\jsp\index_jsp.java:55: cannot find symbol
symbol : class dbPool
location: class org.apache.jsp.index_jsp
dbPool tmp = new dbPool();
^
An error occurred at line: 7 in the jsp file: /index.jsp
Generated servlet error:
C:\WATMServer\Tomcat5\work\Catalina\localhost\_\org\apache\jsp\index_jsp.java:55: cannot find symbol
symbol : class dbPool
location: class org.apache.jsp.index_jsp
dbPool tmp = new dbPool();
^
3 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)