JavaWeb 从数据库获取数据放入页面的下拉列表框中
查数据:publicList<CibDeptView>queryCibDept(){finalCriteriacriteria=this.getSession().cre...
查数据:
public List<CibDeptView> queryCibDept() {
final Criteria criteria = this.getSession().createCriteria(CibDeptView.class);
return criteria.list();
}
获取方法:
private List<CibDeptView> CibDeptList;
public List<CibDeptView> queryDeptList(){
CibDeptList = this.cibDeptDao.queryDeptList();
return CibDeptList;
}
jsp显示:
<select name="dept">
<option value="" selected="true">请选择处室</option>
<%
QueryCibDept cibDept = new QueryCibDept();
List<CibDeptView> list = cibDept.queryDeptList();
for(CibDeptView li:list){
%>
<option value="<%=li.getDept()%>"><%=li.getDept()%></option><%}%>
</select>
请问有什么问题吗?
List<CibDeptView> list = cibDept.queryDeptList();这一行报错
org.apache.jasper.JasperException: 展开
public List<CibDeptView> queryCibDept() {
final Criteria criteria = this.getSession().createCriteria(CibDeptView.class);
return criteria.list();
}
获取方法:
private List<CibDeptView> CibDeptList;
public List<CibDeptView> queryDeptList(){
CibDeptList = this.cibDeptDao.queryDeptList();
return CibDeptList;
}
jsp显示:
<select name="dept">
<option value="" selected="true">请选择处室</option>
<%
QueryCibDept cibDept = new QueryCibDept();
List<CibDeptView> list = cibDept.queryDeptList();
for(CibDeptView li:list){
%>
<option value="<%=li.getDept()%>"><%=li.getDept()%></option><%}%>
</select>
请问有什么问题吗?
List<CibDeptView> list = cibDept.queryDeptList();这一行报错
org.apache.jasper.JasperException: 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
若以下回答无法解决问题,邀请你更新回答
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |