现在我可以从服务器获取 EO,EO 中有一个数组。我只想从数组中获取值,我怎么能得到它?
这是jsp中的代码:
<c:forEach items="${ticketDiscountCriteria.ticketDiscountCarrier}" var="carrier"
varStatus="carrierStatus">
for ( var j = 0; j < searchTicketDiscountForm.ticketDiscountCarrier.length; j++) {
var value = searchTicketDiscountForm.ticketDiscountCarrier[j].value;
alert(value);
<c:if test = "${carrier==value}">
alert(carrier.value);
searchTicketDiscountForm.ticketDiscountCarrier[j].checked = true;
break;
</c:if >
}
</c:forEach>
另一个代码是 EO :
public class TicketDiscountCriteria implements java.io.Serializable {
/**
*
*/
private static final long serialVersionUID = 8427162334846611072L;
private String[] ticketDiscountCarrier;
public String[] getTicketDiscountCarrier() {
return ticketDiscountCarrier;
}
public void setTicketDiscountCarrier(String[] ticketDiscountCarrier) {
this.ticketDiscountCarrier = ticketDiscountCarrier;
}
}
如何获取数组中的值并使用它与复选框值进行比较?请帮我。