I have a JSP page that takes values from the user and shows it in next page (review page before saving). I have bean that has all the values mapped to the fields of the JSP.
@Component
@Scope("session")
public class Campaign implements Serializable {
protected List<Reason> reasons;
.....
.....
}
Reason.java
@Component
public class Reason implements Serializable {
private static final long serialVersionUID = 1L;
private int id;
private String reason;
private int retryDuration;
....
}
In the jsp a table populates the values of the Reasons. When I press submit, the reasons gets the populated values. If there were any validation error in other fields, the page reloads with the error labels displayed below the respective fields. Now if I delete a row in the table that populates the reasons and submit the form, the form still contains the values that was removed too. In the jsp the row is deleted, to check this, I even deleted rows in the jsp using firebug and submitted the page. Still I see the fields are not reset. why is this strange behavior? Am I missing anything in the configuration?