I was trying to bind POJO using spring form
tag library. After binding reference class bean variables, I am getting "Bad Request Error- Http Status 400".
If I remove binding of reference class, My form is submitted successfully and values are also populated inside the class.
public class EmployeeTourPojo {
private String empDisplayName;
private List<TourDetailsPojo> tourDetails;
//getter and setter
}
and
public class TourDetailsPojo {
private Date departDate;
private String departTime;
//getters and setters
}
JSP:
<td><form:input path="empDisplayName" class="form-control"/> </td>
<form:input placeholder="Departure Date" path="tourDetails[${index}].departDate" required="required" class="datepicker form-control"/><br/>
I had got references from few articles but they are loading the list of reference bean at the get request while I am adding the rows before the submitting the JSP.