欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

web开发jsp+java MVC 关于form的一个细节问题_html/css_WEB-ITnose

程序员文章站 2022-04-29 20:02:38
...
这是一个订单展示然后有一个按钮取消订单的
这个链接按钮应该是放在form里
但是因为我的订单是从数据库里调的
不知道有多少个订单
所以form也应该是动态生成的
像我这样写可以 只用了一个form 一个订单
要是把form放到循环里就没用了
就是下面这样
ReserveList里面已经存好了多个订单对象
for(int i=0;i取消");}

该怎么办???
想了好久都没有办法。。。求助


完整代码
package serv.BD;import java.io.IOException;import java.io.PrintWriter;import java.util.ArrayList;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import dao.BD.daoBDReserve;import dao.BD.daoBDReserveDetail;import dao.DT.daoDTRoomType;import vo.BD.voBDReserve;import vo.BD.voBDReserveDetail;import vo.DT.voDTRoomType;@SuppressWarnings("serial")public class servBDReserveShow extends HttpServlet {	public servBDReserveShow() {		super();	}	public void destroy() {		super.destroy(); 	}	public void doPost(HttpServletRequest request, HttpServletResponse response)			throws ServletException, IOException {				response.setContentType("text/html;charset==utf-8");		request.setCharacterEncoding("gb2312");		response.setCharacterEncoding("utf-8");		PrintWriter out = response.getWriter();		ArrayList ReserveList=new ArrayList();			daoBDReserve daoBDReserve = new daoBDReserve();		daoBDReserveDetail daoBDReserveDetail = new daoBDReserveDetail();        String membernum=request.getParameter("mnum");         ReserveList=daoBDReserve.showReserve(membernum);         if(membernum!=null){	        				out.println(""-//W3C//DTD HTML 4.01 Transitional//EN\">");			out.println("");			out.println("");			out.println("");			out.println("Reserve");			out.println("");			out.println("");				out.println("");			out.println("");			out.println("");			out.println("
"); out.println("
"); out.println(""); out.println("
"); out.println(""); out.println("
"); out.println("
"); out.println("
"); out.println("
"); out.println("web开发jsp+java MVC 关于form的一个细节问题_html/css_WEB-ITnose"); out.println("
"); out.println("
"); out.println("web开发jsp+java MVC 关于form的一个细节问题_html/css_WEB-ITnose"); out.println("
"); out.println(""); out.println(""); out.println("
"); out.println(""); out.println("
"); for(int i=0;i"); out.println("
"); out.println("
"); out.println("
    "); out.println("
    "); out.println("

    订单"+(i+1)+"

    "); out.println("

    |订单号:"+voBDReserve0.getReserveNum()+"

    "); out.println(" "); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(" "); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println("
    订单状态入住时间入住天数房间类型总价
    明细"+voBDReserveDetail0.getResstateNum()+""+voBDReserveDetail0.getCheckInTime()+""+voBDReserveDetail0.getStayDays()+""+voRoomType.getTypeName()+""+voBDReserve0.getFontMoney()+"元"); out.println("取消"); out.println("
    "); out.println("
    "); out.println("
"); out.println(" "); out.println("
"); out.println("
"); out.println("
"); out.println("