Home > front end >  Bosses javaweb how to select the check box of the inside of the data in the database? Emergency!!!!!
Bosses javaweb how to select the check box of the inside of the data in the database? Emergency!!!!!

Time:10-01

the selected goods add to cart to order list
Shopping cart is & lt; C: forEach items="${goodscar}" var="goodscar & gt;" Circulation of


JSP

The function orderform () {
//

Var a="";
$(" danchecked: checked "). The parent (). The prev (). Each (function (I) {
A +=$(this). The text () + ", ";
})
Document. The location="Selectsite? Id="+ a;
}


servlet

String goodcarid=request. The getParameter (" id ");

Int a=0;

String [] 'arry=goodcarid. Split (", ");

for(int i=0; I<'arry. Length; I++) {
A=Inte ger. ParseInt (' arry [I]);

//entity class
The Orders the Orders=new Orders (0, 0, 0, a, usernumber, time, "");
//call the method that deposited in
Ines. The addorder (orders);

}
get the selected id and then separated by a comma in the servlet by comma split cycle get id but don't go in this way doesn't work, how can I save? Ask bosses to help
  • Related