I've CoverageInfoVO type array in my Action class and want to send value from jsp to action class, but it's not getting mapped. Instead of array If I switch to ArrayList it's working fine. My doubt is, can't we pass array from jsp to Action in struts2 ? I've added code snippet for better illustration.
JSP
<input type="text" name="coverageInfoList[0].month">
Action
public class MyAction {
private CoverageInfoVO[] coverageInfoList;
public CoverageInfoVO[] getCoverageInfoList() {
return coverageInfoList;
}
public void setCoverageInfoList(CoverageInfoVO[] coverageInfoList) {
this.coverageInfoList = coverageInfoList;
}
........
}
CoverageInfoVO
public class CoverageInfoVO {
private String month;
private String enrollmentPremium;
private String secondLowestCostSilverPlanPremium;
private String advancePaymentOfPremiumTaxCredit;
public String getMonth() {
return month;
}
public void setMonth(String month) {
this.month = month;
}
...................
}