Compares the elements in the discs and outlets of two objects for equality. Same, the corresponding checkbox is checked
<div id= "Div1" name= "Div1" class= "area" style= "position:relative;" >
<c:if test= "${!empty outlets}" >
<dl>
<c:foreach items= "${outlets}" var= "outlet" >
<c:set var= "has" value= "0" ></c:set>
<dd>
<c:if test= "${!empty discs}" >
<c:foreach items= "${discs}" var= "discs" >
<c:if test= "${discs.outlet==outlet.outlet}" >
<c:set var= "has" value= "1" ></c:set>
</c:if>
</c:forEach>
</c:if>
<input id= "outlet" type= "checkbox" Value= "${outlet.outlet}" id= "${outlet.outlet}" name= "outlet" <c:if test= "${ Has==1} ">checked=" Checked "</c:if>/>
<label for= "${outlet.outlet}" >${outlet.outlet}-${outlet.desc1}</label>
</dd>
</c:forEach>
</dl>
</c:if>
</div>
Controller Transfer Discs,outlets
List<discs> Discs=discsservice.getdiscsbycode (code);
/* SYSTEM.OUT.PRINTLN (discs.get (0). Getoutlet () + "@@");
System.out.println (Discs.get (1). Getoutlet () + "!! ");
System.out.println (Discs.get (2). Getoutlet () + "# #"); */
Model.addattribute ("discs", discs);
List<outlet> outlets = Outletservice.getoutlets ();
/*system.out.println (Outlets.get (0). Getoutlet ());
System.out.println (Outlets.get (1). Getoutlet ());
System.out.println (Outlets.get (2). Getoutlet ()); * *
Model.addattribute ("outlets", outlets);
The controller compares two objects discs, outlets elements in equality. Same, the corresponding checkbox is checked