Java Reference
In-Depth Information
public void setUwrBusinessDelegate(
UnderWritingBusinessDelegate uwrBusinessDelegate) {
this.uwrBusinessDelegate = uwrBusinessDelegate;
}
/*
protected ModelAndView onSubmit(Object formbean) throws Exception {
PolicyFormBean policyBean = (PolicyFormBean)formbean;
uwrBusinessDelegate.createPolicy(policyBean);
return new ModelAndView(this.getSuccessView(),"policydetails",formbean);
}
*/
}
To use the SimpleFormController , you have to set a few configuration parameters. The
first property is the commandName property. This name is used as the key for the form bean
object set in the model. The next property you need to consider is successView . This spec-
ifies a logical view name just like the property formView . This view will be used to render a
response in case of a successful form submission. Listing 3-28 shows the configuration
details.
Note that the command class/form bean has also been configured in
insurance-servlet.xml . Hence, you don't need to register the form bean in the
constructor of the page controller.
Listing 3-28. insurance-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=" http://www.springframework.org/schema/beans"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
>
<bean name="/createPolicy.do"
class="com.apress.insurance.web.controller.SaveNewPolicyController" >
<property name="uwrBusinessDelegate"
ref="underwritingBusinessDelegate" />
 
Search WWH ::




Custom Search