后端代码
@IocBean
@At("/Menu")
public class MenuController {
@Inject
private Menu menu;
@At("/query_All_Menu")
@Ok("jsp:demo")
public List<Show> queryAllMenu(HttpServletRequest request,HttpSession session){
int user = (int)session.getAttribute("user");
List<Show> shows = menu.queryAllMenu(user);
request.setAttribute("shows",shows);
return shows;
}
}
前端代码
<body>
<div class="layui-tab" lay-filter="demo">
<ul class="layui-tab-title">
<li class="layui-this">网站设置</li>
<li>商品管理</li>
<li>订单管理</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<c:forEach items="${user}" var="show">
<table>
<tr>
<th>菜名</th>
<th>价格</th>
<th>图片</th>
</tr>
<tr>
<td>${show.foodname}</td>
<td>${show.foodmoney}</td>
<td>${show.foodimg}</td>
</tr>
</table>
</c:forEach>
</div>
<div class="layui-tab-item">内容2</div>
<div class="layui-tab-item">内容3</div>
</div>
</div>
<%--<script src="plugins/layui/layui.js"></script>--%>
<%--<script src="js/demo.js"></script>--%>
</body>
16 回复
添加回复
请先登陆