始终报空值错误,在action里测试了list已经成功传入session

<%@ page language="java" import="java.util.*,org.easybooks.bookstore.vo.Greens" pageEncoding="utf-8"  isELIgnored="false"%><%@	taglib prefix="s" uri="/struts-tags"%><script type="text/javascript">	setInterval(function () {		window.location.reload();	}, 5000);	// 单位: 毫秒, 1000 = 1 秒</script><html>	<head><title>主页</title></head>	<body>		<s:property value="user.username"/>,您好!欢迎食堂售饭系统		<a href="addGreens.jsp">添加</a>		<a href="welcome.jsp">首页</a><form action="select.action" method="post" name="formG"><table class="table table-striped table-hover table-bordered">			<thead>            <tr align="center">               <th>名称</th>               <th>价格</th>               <th>数量</th>               <th>操作</th>             </tr></thead>            <tbody> <%              HttpSession s = request.getSession();              	List list = (List)s.getAttribute("greens");             	out.print(list.get(0));             	Greens g =new Greens();             	for(int i=0;i<list.size();i++){             		g = (Greens)list.get(i);             		%>             		<tr><td><%=g.getName() %></td>             		<td><%=g.getPrice() %></td>             		<td><%=g.getNumber() %></td>             		<td> <a href="update.jsp?name=<%=g.getName()%>&price=<%=g.getPrice()%>&number=<%=g.getNumber() %>">修改</a></td>             		<td> <a href="deleteGreens.jsp?name=<%=g.getName()%>">删除</a></td>             		</tr>             		             		<%             	}              %></tbody></table></form>	</body></html>


枫夜流萤
浏览 1028回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java