用JavaBean时的错误,实在不知道是怎么回事了!!
org.apache.jasper.JasperException: org.apache.jasper.
JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
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)
我错误在哪呢?JAVA文件我放在了SRC里,CLASS文件放在了CLASSES里,页面使用代码是:
<%@ page import= "bean.connDB "%>
<jsp:useBean id= "connDB " scope= "page " class= "beans.connnDB "/>
<%
try{
connDB conn=new connDB();
String sql= "select * from test_procdcts ";
ResultSet result=conn.executeQuery(sql);
int temp=0;
while(result.next()) { temp=temp+1; String tem=result.getString( "id ");String picture_id=result.getString( "pic_id ");%>
<%}%>
<%out.print( "kdfj ");conn.close();
}catch(Exception eeeee){
out.print( "错误!!!!!! ");
}
%>
请高人帮忙,如果还需要JAVA源程序,请顶一下! 我就来发!!
------解决方案--------------------不用user:bean
import 中加入类就行
下面在 <% %>
------解决方案--------------------你为什么要用 <jsp:useBean> 呢?
你又不是从隐式对象中取得的connDB
你只要自己在 <%%> 中new出来就可以啦