Java Reference
In-Depth Information
First Name <input type="text" name="firstName" value="" /><br/>
Last Name <input type="text" name="lastName" value="" /><br/>
Age <input type="text" name="age" value="" /><br/>
<input type="submit" value="Save" />
SaveNewPolicyController now extends the SimpleFormController as shown in
Listing 3-25. Note that this version is suitable only for form display.
Listing 3-25.
public class SaveNewPolicyController extends SimpleFormController {
private UnderWritingBusinessDelegate uwrBusinessDelegate;
public SaveNewPolicyController() {
public void setUwrBusinessDelegate(
UnderWritingBusinessDelegate uwrBusinessDelegate) {
this.uwrBusinessDelegate = uwrBusinessDelegate;
Finally, I will wire up the beans in the Spring configuration file as shown in
Listing 3-26. This is a very clean configuration. A GET request for / is inter-
cepted by the SaveNewPolicyController , which considers this as a form display request.
The property formView serves as a logical view name, which is resolved to the physical
view /WEB-INF/jsp/createPolicy.jsp to present the form to the end user.
Listing 3-26. insurance-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
Search WWH ::

Custom Search