Java Reference
In-Depth Information
protected Object formBackingObject(HttpServletRequest req) throws Exception {
PolicyFormBean policyBean = (PolicyFormBean)super.formBackingObject(req);
List productList = (List) req.getSession(false).getServletContext()
.getAttribute("productCodeList");
policyBean.setProductCodeList(productList);
return policyBean;
}
}
Since I have added a field in the form presented by the JSP, a new field has to be
added to the form bean class. Listing 3-53 shows the modified version of the form bean.
Listing 3-53. PolicyFormBean.java
public class PolicyFormBean implements Serializable {
private String firstName;
private String lastName;
private int age;
private List productCodeList;
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
 
Search WWH ::




Custom Search