Java Reference
In-Depth Information
Figure 3-10. Form display workflow in SimpleFormController
This is an oversimplified workflow, because I want to focus only on areas of interest.
You can find a detailed workflow and explanation in the topic Expert Spring MVC and
Web Flow (Apress, 2006). As shown in Figure 3-11, the web browser's request for a
resource is eventually delegated to the page controller. The SimpleFormController detects
that the request has come via HTTP GET , so this is not a form submission but a request
for form display. It creates an instance of the form bean and makes the form ready to be
displayed.
I will now take up the example discussed earlier with AbstractCommandController and
try to implement it with SimpleFormController because the latter offers greater flexibility.
As a first step, I will simplify the JSP as shown in Listing 3-24. Note that JavaScript is not
used to submit the form anymore. Also notice that the action attribute of the form does
not specify a value. This removes any coupling with a particular action URL. Apart from
these two changes, the JSP is the same as the one presented in Listing 3-20.
Listing 3-24. WEB-INF/jsp/createPolicy.jsp
<html>
<head>
<title>Underwriting</title>
</head>
<form action="" method="POST">
 
Search WWH ::




Custom Search