這個JSP頁面,第一次進去時要顯示45行代碼中得到的訂單信息,在點擊23行的組合查詢時,又能顯示查詢得到的訂單信息。這個功能怎么實現啊,查詢相關的servlet已經寫好,但是不知道怎么傳給前臺,前臺要怎樣才能實現這兩種輸出?<%@page import="cn.pb.news.entity.Bill"%><%@page import="java.util.List"%><jsp:useBean id="billService" class="cn.pb.news.service.impl.BillServiceImpl" scope="page"/><%@ page language="java" contentType="text/html; charset=UTF-8"??? pageEncoding="UTF-8"%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link type="text/css" rel="stylesheet" href="../css/style.css"/><title>Insert title here</title></head><body>?? ?<div class="menu">?? ?<form method="post" action="<%=request.getContextPath() %>/servlet/QueryBillServlet?opr=query">?? ??? ?商品名稱:<input type="text" name="productName" class="input-text" /> ?? ??? ?是否付款:<select name="payStatus">?? ??? ??? ?<option value="">請選擇</option>?? ??? ??? ?<option value="1">已付款</option>?? ??? ??? ?<option value="0">未付款</option>?? ??? ?</select> ?? ??? ?<input type="submit" name="submit" value="組合查詢" class="button" />?? ?</form></div><div class="main">?? ?<div class="optitle clearfix">?? ??? ?<em><input type="button" name="button" value="添加數據" class="input-button" onclick="location.href='modify.jsp'" /></em>?? ??? ?<div class="title">賬單管理>></div>?? ?</div>?? ?<div class="content">?? ??? ?<table class="list">?? ??? ??? ?<tr>?? ??? ??? ??? ?<td>賬單編號</td>?? ??? ??? ??? ?<td>商品名稱</td>?? ??? ??? ??? ?<td>商品數量</td>?? ??? ??? ??? ?<td>交易金額</td>?? ??? ??? ??? ?<td>是否付款</td>?? ??? ??? ??? ?<td>供應商名稱</td>?? ??? ??? ??? ?<td>商品描述</td>?? ??? ??? ??? ?<td>賬單時間</td>?? ??? ??? ?</tr>?? ??? ??? ?<%// ?? ??? ??? ??? ?BillService billService = new BillServiceImpl();?? ??? ??? ??? ?List<Bill> billList = billService.getBillList();?? ??? ??? ??? ?request.getAttribute("BillList");?? ??? ??? ??? ?for(Bill bill : billList) {?? ??? ??? ??? ??? ??? ??? ?%><!-- ?? ??? ??? ?<c:forEach items="${requestScope.billList}" var="bill"> --><!-- ?? ??? ??? ??? ?<tr> --><!-- ?? ??? ??? ??? ??? ?<td><c:out value="${bill.Id}" default="moren"></c:out></td> --><!-- ?? ??? ??? ??? ??? ?<td><c:out value="${bill.productName}"></c:out></td> --><!-- ?? ??? ??? ??? ??? ?<td><c:out value="${bill.counts}"></c:out></td> --><!-- ?? ??? ??? ??? ??? ?<td><c:out value="${bill.billMoney}"></c:out></td> --><!-- ?? ??? ??? ??? ??? ?<td><c:out value="${bill.isPay}"></c:out></td> --><!-- ?? ??? ??? ??? ??? ?<td><c:out value="${bill.productName}"></c:out></td> --><!-- ?? ??? ??? ??? ??? ?<td><c:out value="${bill.productDesc}"></c:out></td> --><!-- ?? ??? ??? ??? ??? ?<td><c:out value="${bill.billTime}"></c:out></td> --><!-- ?? ??? ??? ??? ?</tr> --><!-- ?? ??? ??? ?</c:forEach> -->?? ??? ??? ?<tr>?? ??? ??? ??? ?<td><%=bill.getId()%></td>?? ??? ??? ??? ?<td><%=bill.getProductName()%></td>?? ??? ??? ??? ?<td><%=bill.getCounts() %></td>?? ??? ??? ??? ?<td><%=bill.getBillMoney() %></td>?? ??? ??? ??? ?<td><%=bill.getIsPay() %></td>?? ??? ??? ??? ?<td><%=bill.getProductName() %></td>?? ??? ??? ??? ?<td><%=bill.getProductDesc() %></td>?? ??? ??? ??? ?<td><%=bill.getBillTime() %></td>?? ??? ??? ?</tr>?? ??? ??? ?<%?? ??? ??? ??? ?}?? ??? ??? ?%>?? ??? ?</table>?? ?</div></div></body></html>
添加回答
舉報
0/150
提交
取消