javax.servlet.jsp.el.ELException
<jsp:useBeanid="getdatabean"class="ch03.GetDataBean"scope="session"></jsp:useBean><c:...
<jsp:useBean id="getdatabean" class = "ch03.GetDataBean" scope = "session"></jsp:useBean>
<c:set var="foods" value = "${getdatabean.getFoods }" scope = "session"></c:set>
然后在GetDataBean中的方法:
public List Foods(){
ResultSet rs = null;
List foodsList = new ArrayList();
try {
rs = this.getPs("select * from foodInfo order by foodID").executeQuery();
while(rs.next()){
FoodBean food = new FoodBean();
food.setFoodID(rs.getString("foodID"));
food.setFoodName(rs.getString("foodName"));
food.setDescription(rs.getString("description"));
food.setFoodImage(rs.getString("foodImage"));
food.setFoodPrice(rs.getDouble("foodPrice"));
food.setRemark(rs.getString("remark"));
foodsList.add(food);
}
} catch (Exception e) {
return null;
}
this.closeConnection();
return foodsList;
}
在<c:set></c:set>那里报错:javax.servlet.jsp.el.ELException: Unable to find a value for "getFoods" in object of class "ch03.GetDataBean" using operator "."
不知道是什么原因,请教大家谢谢啦!!!
1L的朋友,改成${getdatabean.Foods }后依然有错,还是报同样的错呢 展开
<c:set var="foods" value = "${getdatabean.getFoods }" scope = "session"></c:set>
然后在GetDataBean中的方法:
public List Foods(){
ResultSet rs = null;
List foodsList = new ArrayList();
try {
rs = this.getPs("select * from foodInfo order by foodID").executeQuery();
while(rs.next()){
FoodBean food = new FoodBean();
food.setFoodID(rs.getString("foodID"));
food.setFoodName(rs.getString("foodName"));
food.setDescription(rs.getString("description"));
food.setFoodImage(rs.getString("foodImage"));
food.setFoodPrice(rs.getDouble("foodPrice"));
food.setRemark(rs.getString("remark"));
foodsList.add(food);
}
} catch (Exception e) {
return null;
}
this.closeConnection();
return foodsList;
}
在<c:set></c:set>那里报错:javax.servlet.jsp.el.ELException: Unable to find a value for "getFoods" in object of class "ch03.GetDataBean" using operator "."
不知道是什么原因,请教大家谢谢啦!!!
1L的朋友,改成${getdatabean.Foods }后依然有错,还是报同样的错呢 展开
3个回答
展开全部
<c:set var="foods" value = "${getdatabean.getFoods }" scope = "session"></c:set>
中这个el表达式有误${getdatabean.getFoods },应该写为:${getdatabean.foods }默认就会调用getdatabean这个bean的getFoods()方法!
中这个el表达式有误${getdatabean.getFoods },应该写为:${getdatabean.foods }默认就会调用getdatabean这个bean的getFoods()方法!
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<c:forEach var="ss" items="${supply}">
<tr bgcolor="#faf9f5" onclick="show(this)" ondblclick="change('${ss.userName}','${ss.buMen }')">
<td>${ss.userID}</td>
<td>${ss.userZhanghao}</td>
<Td>${ss.userName}</Td>
<Td>${ss.buMen }</Td>
</tr>
</c:forEach>
<tr bgcolor="#faf9f5" onclick="show(this)" ondblclick="change('${ss.userName}','${ss.buMen }')">
<td>${ss.userID}</td>
<td>${ss.userZhanghao}</td>
<Td>${ss.userName}</Td>
<Td>${ss.buMen }</Td>
</tr>
</c:forEach>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
报错,看是否是同样的错误。是不是作用域出了问题。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询