Java Reference
In-Depth Information
A lot is happening under the hood in Listing 3-57. Note that a common view resolver
caters to both dynamic and static resources. You can also see the handler mapping chain.
The BeanNameUrlHandlerMapping having higher precedence is selected first. Now a request
for a dynamic resource such as /policysearch.do is resolved by this handler mapping. It
looks for a bean with the name /policydetails.do in the application context and dele-
gates the processing to it. BeanNameUrlHandlerMapping , however, fails to handle the request
for the URL ClaimCreateHelp.do . Hence, the next handler mapping in the chain,
SimpleUrlHandlerMapping , is picked up to resolve this URL to a controller. This handler
mapping succeeds in detecting the controller. It uses wildcards to resolve the incoming
URLs that end in Help.do to an instance of UrlFilenameViewController . Hence,
UrlFilenameViewController handles all requests for static requests without any invocation
of business logic. This concrete controller implementation will convert the request URL
to a logical view name— ClaimCreateHelp . It will then use the prefix to finally return
/help/ClaimCreateHelp . Finally, the view resolver looks for the file /help/ClaimCreateHelp.
jsp in the folder /WEB-INF/jsp and returns the static physical resource. The simplified
workflow is shown in the sequence diagram in Figure 3-18.
Figure 3-18. Dispatcher view sequence diagram
The semistatic views have their data already cached in some form. To use this data,
you can use view helpers. To underwrite insurance policies, you must select a product.
The active products in the system are cached in the ServletContext object at application
startup. The physical resource ProductLoV.jsp is stored in the /WEB-INF/jsp/lookup folder
 
Search WWH ::




Custom Search