Java Reference
In-Depth Information
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
>
<bean name="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<bean name="/createPolicy.do"
class="com.apress.insurance.web.controller.SaveNewPolicyController" >
<property name="uwrBusinessDelegate"
ref="underwritingBusinessDelegate" />
<property name="formView"
value="createPolicy" />
</bean>
<bean name="underwritingBusinessDelegate"
class="com.apress.insurance.view.delegate.UnderWritingBusinessDelegate" />
</beans>
Form Submission
The underwriters using the eInsure application would fill up this form and submit it to
underwrite new policies. The controller determines this request as a form submission,
since the method attribute of the form was set as POST . Now you must be wondering how
this form submits to the URL /createPolicy.do again because the action attribute in the
form is not specified. This in fact is a trick. If the action attribute is empty, the form will
post back to itself, that is, the page that presented the form. This will result in a new POST
request reaching the SaveNewPolicyController . Figure 3-11 shows the form submission
workflow.
 
Search WWH ::




Custom Search