请问Cannot find bean: "listOne" in any scope有关问题
请教Cannot find bean: "listOne" in any scope问题
错误显示:
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2148)
……
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Table 'truelove.cominfoclass_tb' doesn't exist
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2994)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:936)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
... 30 more
一月 01, 2006 12:51:38 上午 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/xiaoye] threw exception [javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: "listOne" in any scope] with root cause
javax.servlet.jsp.JspException: Cannot find bean: "listOne" in any scope
at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:935)
at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:232)
……
页面代码
怎么解决?请教各路高手,谢谢!!
------解决思路----------------------
改成 property="listOne"试试
------解决思路----------------------
Table 'truelove.cominfoclass_tb' doesn't exist 从你报错的原因看是你这张表不存在。你检查下
错误显示:
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2148)
……
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Table 'truelove.cominfoclass_tb' doesn't exist
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2994)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:936)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
... 30 more
一月 01, 2006 12:51:38 上午 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/xiaoye] threw exception [javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: "listOne" in any scope] with root cause
javax.servlet.jsp.JspException: Cannot find bean: "listOne" in any scope
at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:935)
at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:232)
……
页面代码
<%@page import="com.aqsoft.pro.site.impl.ComInfoDAO,java.util.*"%>
<%@page import="com.aqsoft.pro.site.interfaces.ComInfoI"%>
<%@page import="com.aqsoft.pro.pojo.CominfoclassTb"%>
<html>
<head>
<html:base />
<TITLE>ajax</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.3314" name=GENERATOR>
</HEAD>
<BODY>
<input type="hidden" name="bigclassname" id="bigclassname">
<select id="getone" name="getone" onChange="exec()">
<option value="0" selected="selected">
请选择信息大类
</option>
<%
ComInfoI cii = ComInfoDAO.getComInfoDAO();
List<CominfoclassTb> list = cii.findInfoClass(0);
request.setAttribute("listOne", list);
%>
<logic:iterate id="blist" name="listOne"
type="com.aqsoft.pro.pojo.CominfoclassTb">
<option value="${blist.classid}">
${blist.classname}
</option>
</logic:iterate>
</select>
<select name="gettwo" id="gettwo" onChange="getvalue()">
<option selected="selected" value="0">
请选择信息小类
</option>
</select>
</BODY>
</HTML>
怎么解决?请教各路高手,谢谢!!
------解决思路----------------------
<logic:iterate id="blist" name="listOne" type="com.aqsoft.pro.pojo.CominfoclassTb">
<option value="${blist.classid}">
${blist.classname}
</option>
</logic:iterate>
改成 property="listOne"试试
------解决思路----------------------
Table 'truelove.cominfoclass_tb' doesn't exist 从你报错的原因看是你这张表不存在。你检查下