我試圖從JSP頁面訪問多個複選框值獲得多個值..但我結束了錯誤的綁定..無法從複選框
jsp頁面:
<c:forEach items="${employees}" var="employee">
<tr>
<td><spring:checkbox path="selectedMails" value="<c:out value='${employee.emailid}'/>"/> </td>
<td><spring:label path="employeeId">${employee.employeeId}</spring:label></td>
<td><spring:label path="employeeName">${employee.employeeName}</spring:label></td>
<td><spring:label path="emailid" >${employee.emailid}</spring:label></td>
<td><spring:label path="reportmanager">${employee.reportmanager}</spring:label></td>
</tr>
</c:forEach>
DTO
頁//Invitation Beans
private String [] selectedMails;
public String [] getSelectedMails() {
return selectedMails;
}
public void setSelectedMails(String [] selectedMails) {
this.selectedMails = selectedMails;
}
我能夠jsp頁面上打印${employee.emailid}
..但我不能夠找回,我需要保存多個值。請幫我出
是的,你是對的....但如果你看到我的jsp代碼,你會知道我已經在一個循環中使用單個複選框單變量..仍然我無法獲得這些值在數組中。 – Raghuveer
也許類型應該是布爾值? – alexey28