其他分享
首页 > 其他分享> > 团队第一阶段冲刺1总结

团队第一阶段冲刺1总结

作者:互联网

今日就是做了简单分页前台显示,只要做出其中一个分页的效果展示,其他七个分页的表示就简单地改下内容即可。因为我这是补写的,所以现在就大概地梳理一下

分页显示:

  

相关代码

<%@ page import="com.supercook.bean.Food" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.supercook.bean.Windows" %><%--
  Created by IntelliJ IDEA.
  User: 15251
  Date: 2022/4/22
  Time: 11:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>positionquery</title>
    <base href="http://localhost:8080/supercook/">
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <script type="text/javascript" src="jquery-1.7.2.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#query").click(function () {
            })
        })
    </script>
</head>
<body>
<div class="container" style="margin-top: 20px">
    <form action="foodservlet" method="POST" class="form-inline">
        <input type="hidden" name="action" value="listdrink">
        <div class="form-group ">
            <label for="drink" class="control-label">饮料</label>
            <input type="text" class="form-control"  id="drink" name="foodname" placeholder="请填写饮料名">
        </div>
        <button type="submit" class="btn btn-primary" id="query1">query</button>
    </form>
    <div class="row"><button class="btn btn-info"><a href="daohang.jsp">返回主页</a></button></div>
    <hr>
    <div id="show1" style="display: block">
        <div class="container">
            <div>
                <%
                    ArrayList<Food> foodlist1 = (ArrayList<Food>) request.getAttribute("foodlist1");
                    ArrayList<Windows> srcList1 = (ArrayList<Windows>) request.getAttribute("srcList");
                    if(foodlist1!=null){
                %>
                <%for(int i=0;i<foodlist1.size();i++){
                    Food food = foodlist1.get(i);
                    Windows windows = srcList1.get(i);%>
                <div class="row" style="background-color: antiquewhite">
                    <div class="col-sm-6 col-md-4">
                        <br>
                        <div class="thumbnail">
                            <img src="<%=windows.getSrc()%>">
                            <div class="caption">
                                <h3><%=food.getFoodname()%></h3>
                                <form action="foodservlet" method="post">
                                    <input type="hidden" name="action" value="dianzan1">
                                    <input type="hidden" value="<%=food.getPosition()%>" name="name">
                                    <input type="hidden" value="" name="dizhi">
                                    <p><input type="submit" value="点赞" class="btn btn-primary glyphicon glyphicon-thumbs-up" role="button"></p>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <div class="row" style="text-align: center;margin-top: 3px">食物信息显示</div>
                        <table class="table table-bordered" style="margin-top: 0px">
                            <!-- On rows -->
                            <tr class="active"><td width="15%">食物名:</td><td><%=food.getFoodname()%></td></tr>
                            <br>
                            <tr class="success"><td>食物价格:</td><td><%=food.getPrice()%></td></tr>
                            <br>
                            <tr class="warning"><td>食物位置:</td><td><%=food.getPosition()%></td></tr>
                            <br>
                            <tr class="info"><td>食物种类:</td><td><%=food.getKind()%></td></tr>
                        </table>
                    </div>
                </div>
                <hr>
                <%}%>
            </div>
            <%}%>
        </div>
    </div>
        <%
        ArrayList<Food> foodlist = (ArrayList<Food>) request.getAttribute("foodlist");
            ArrayList<Windows> srcList = (ArrayList<Windows>) request.getAttribute("srcList");
        if(foodlist!=null){
    %>
    <div id="show" style="display: block">
        <div class="container">
            <div>
                <%for(int i=0;i<foodlist.size();i++){
                    Food food = foodlist.get(i);
                    Windows windows = srcList.get(i);%>
                <div class="row" style="background-color: antiquewhite">
                    <div class="col-sm-6 col-md-4">
                        <br>
                        <div class="thumbnail">
                            <img src="<%=windows.getSrc()%>">
                            <div class="caption">
                                <h3><%=food.getFoodname()%></h3>
                                <form action="foodservlet" method="post">
                                    <input type="hidden" name="action" value="dianzan1">
                                    <input type="hidden" value="<%=food.getPosition()%>" name="name">
                                    <input type="hidden" value="" name="dizhi">
                                    <p><input type="submit" value="点赞" class="btn btn-primary glyphicon glyphicon-thumbs-up" role="button"></p>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <div class="row" style="text-align: center;margin-top: 3px">食物窗口信息显示</div>
                        <table class="table table-bordered" style="margin-top: 0px">
                            <!-- On rows -->
                            <tr class="active"><td width="15%">食物名:</td><td><%=food.getFoodname()%></td></tr>
                            <br>
                            <tr class="success"><td>食物价格:</td><td><%=food.getPrice()%></td></tr>
                            <br>
                            <tr class="warning"><td>食物位置:</td><td><%=food.getPosition()%></td></tr>
                            <br>
                            <tr class="info"><td>食物种类:</td><td><%=food.getKind()%></td></tr>
                        </table>
                    </div>
                </div><hr>
                <%}%>
            </div>
            <%}%>
        </div>
    </div>
</div>
</body>
</html>
<%@ page import="com.supercook.bean.Food" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.supercook.bean.Windows" %><%--
  Created by IntelliJ IDEA.
  User: 15251
  Date: 2022/4/22
  Time: 11:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>positionquery</title>
    <base href="http://localhost:8080/supercook/">
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <script type="text/javascript" src="jquery-1.7.2.js"></script>
    <script type="text/javascript">
        $(function () {

        $("#query").click(function () {
            })
        })
    </script>
</head>
<body>
<div class="container" style="margin-top: 20px">
    <form action="foodservlet" method="POST" class="form-inline">
        <input type="hidden" name="action" value="listdish">
        <div class="form-group ">
            <label for="dish" class="control-label">面食配餐</label>
            <input type="text" class="form-control"  id="dish" name="foodname" placeholder="请填写配餐名">
        </div>
        <button type="submit" class="btn btn-primary" id="query1">query</button>
    </form>
    <div class="row"><button class="btn btn-info"><a href="daohang.jsp">返回主页</a></button></div>
    <hr>
    <div id="show1" style="display: block">
        <div class="container">
            <div>
                <%
                    ArrayList<Food> foodlist1 = (ArrayList<Food>) request.getAttribute("foodlist1");
                    ArrayList<Windows> srcList1 = (ArrayList<Windows>) request.getAttribute("srcList");
                    if(foodlist1!=null){
                %>
                <%for(int i=0;i<foodlist1.size();i++){
                    Food food = foodlist1.get(i);
                    Windows windows = srcList1.get(i);%>
                <div class="row" style="background-color: antiquewhite">
                    <div class="col-sm-6 col-md-4">
                        <br>
                        <div class="thumbnail">
                            <img src="<%="image/1.1.jpg"%>">
                            <div class="caption">
                                <h3><%=food.getFoodname()%></h3>
                                <form action="foodservlet" method="post">
                                    <input type="hidden" name="action" value="dianzan1">
                                    <input type="hidden" value="<%=food.getPosition()%>" name="name">
                                    <input type="hidden" value="" name="dizhi">
                                    <p><input type="submit" value="点赞" class="btn btn-primary glyphicon glyphicon-thumbs-up" role="button"></p>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-8">
                        <div class="row" style="text-align: center;margin-top: 3px">食物信息显示</div>
                        <table class="table table-bordered" style="margin-top: 0px">
                            <!-- On rows -->
                            <tr class="active"><td width="15%">食物名:</td><td><%=food.getFoodname()%></td></tr>
                            <br>
                            <tr class="success"><td>食物价格:</td><td><%=food.getPrice()%></td></tr>
                            <br>
                            <tr class="warning"><td>食物位置:</td><td><%=food.getPosition()%></td></tr>
                            <br>
                            <tr class="info"><td>食物种类:</td><td><%=food.getKind()%></td></tr>
                        </table>
                    </div>
                </div>
                <hr>
                <%}%>
            </div>
                <%}%>
        </div>
    </div>
        <%
            ArrayList<Food> foodlist = (ArrayList<Food>) request.getAttribute("foodlist");
            ArrayList<Windows> srcList = (ArrayList<Windows>) request.getAttribute("srcList");
            if(foodlist!=null){
        %>
        <div id="show" style="display: block">
            <div class="container">
                <div>
                    <%for(int i=0;i<foodlist.size();i++){
                        Food food = foodlist.get(i);
                        Windows windows = srcList.get(i);%>
                    <div class="row" style="background-color: antiquewhite">
                        <div class="col-sm-6 col-md-4">
                            <br>
                            <div class="thumbnail">
                                <img src="<%=windows.getSrc()%>">
                                <div class="caption">
                                    <h3><%=food.getFoodname()%></h3>
                                    <form action="foodservlet" method="post">
                                        <input type="hidden" name="action" value="dianzan1">
                                        <input type="hidden" value="<%=food.getPosition()%>" name="name">
                                        <input type="hidden" value="/xiaochi.jsp" name="dizhi">
                                        <p><input type="submit" value="点赞" class="btn btn-primary glyphicon glyphicon-thumbs-up" role="button"></p>
                                    </form>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-8">
                            <div class="row" style="text-align: center;margin-top: 3px">食物窗口信息显示</div>
                            <table class="table table-bordered" style="margin-top: 0px">
                                <!-- On rows -->
                                <tr class="active"><td width="15%">食物名:</td><td><%=food.getFoodname()%>></td></tr>
                                <br>
                                <tr class="success"><td>食物价格:</td><td><%=food.getPrice()%></td></tr>
                                <br>
                                <tr class="warning"><td>食物位置:</td><td><%=food.getPosition()%></td></tr>
                                <br>
                                <tr class="info"><td>食物种类:</td><td><%=food.getKind()%></td></tr>
                            </table>
                        </div>
                    </div><hr>
                    <%}%>
                </div>
                <%}%>
            </div>
        </div>
    </div>
</body>
</html>

 

标签:foodlist1,name,getAttribute,ArrayList,request,冲刺,食物,团队,第一阶段
来源: https://www.cnblogs.com/20203923rensaihang/p/16373318.html