Java Reference
In-Depth Information
<td colspan="3">
<input type="submit" value="Search" />
Listing 3-50 shows the controller that invokes the business components to retrieve
the search results and then prepares the list to be retrieved and used by the JSTL tags. To
use the JSTL tags, you must put jstl.jar and standard.jar in the WEB-INF/lib folder.
Listing 3-50.
public class PolicySearchController implements Controller {
private UnderWritingBusinessDelegate businessDelegate;
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response)
throws Exception {
List policyList = getBusinessDelegate().listPolicyByProduct(productCd);
return new ModelAndView("policysearch","policyDtlList",policyList);
Using Spring Tags
JSTL tags help encapsulate common tasks that allow the static view to be interposed with
dynamic model data. But it does not support component-based views. Spring form tags
provide this functionality to an extent. You have already used Spring form tags to display
input text fields and validation error messages in Listing 3-33. I will now add one more
field in the JSP used to underwrite policies. Underwriting a policy requires mandatory
product code information. So, in the createPolicy.jsp file, I will add a new drop-down
control that will enable the underwriters to select a product code. This is shown in
Listing 3-51.
Search WWH ::

Custom Search