利用javabean 访问数据库问题
tomcat默认虚拟目录下,没有classses 文件夹,于是,我在root的WEB-INF下手动建了一个classes,根据jsp文件<jsp:useBean id="DBConnect" scope="page" class="db.DBConnect" /> ,又在classes 里建了个db 文件夹,它下面放了DBConnect.class文件,又用这个jsp文件去调用它,可是却报错:
HTTP Status 500 - [bold]type[/bold] Exception report
[bold]message[/bold]
[bold]description[/bold] [underline]The server encountered an internal error () that prevented it from fulfilling this request.[/underline]
[bold]exception[/bold] org.apache.jasper.JasperException: /ceshi.jsp(16,0) The value for the useBean class attribute db.DBConnect is invalid. org.apache.(DefaultErrorHandler.java:40) org.apache.(ErrorDispatcher.java:407) org.apache.(ErrorDispatcher.java:148) org.apache.(Generator.java:1200) org.apache.(Node.java:1155) org.apache.(Node.java:2336) org.apache.(Node.java:2386) org.apache.(Node.java:2392) org.apache.(Node.java:489) org.apache.(Node.java:2336) org.apache.(Generator.java:3394) org.apache.(Compiler.java:210) org.apache.(Compiler.java:306) org.apache.(Compiler.java:286) org.apache.(Compiler.java:273) org.apache.jasper.(JspCompilationContext.java:566) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
[bold]note[/bold] [underline]The full stack trace of the root cause is available in the Apache Tomcat/6.0.10 logs.[/underline]
[underline]这是怎么回事啊!class文件到底放哪,才可用啊!请大家帮帮我。[/underline]