Java Reference
In-Depth Information
public String getLastName() {
return lastName;
public void setLastName(String lastName) {
this.lastName = lastName;
Thus, a form bean is a POJO with a get and set method for each field. Note that the
field name in this class exactly matches the name attribute of the HTML input elements.
Listing 3-22 shows the controller implementation.
Listing 3-22.
public class SaveNewPolicyController extends AbstractCommandController {
private UnderWritingBusinessDelegate uwrBusinessDelegate;
public SaveNewPolicyController() {
public void setUwrBusinessDelegate(
UnderWritingBusinessDelegate uwrBusinessDelegate) {
this.uwrBusinessDelegate = uwrBusinessDelegate;
protected ModelAndView handle(HttpServletRequest request,
HttpServletResponse res, Object formBean, BindException errors)
throws Exception {
PolicyFormBean policyBean = (PolicyFormBean) formBean;"First Name--" + policyBean.getFirstName());"Last Name--" + policyBean.getLastName());"Age --" + policyBean.getAge());
return new ModelAndView("showPolicydetails","policydetails",policyBean);
Search WWH ::

Custom Search