Java Reference
In-Depth Information
Listing 3-10. /WEB-INF/classes/
The base resource bundle file is called . Depending on the locale,
the other resources will be named and so on. But this can be
changed by configuration. So when a view named policydetails is requested, the view
resolver creates a new instance of the JstlView class. This class represents a JSP-based
view that uses the JSP Standard Tag Library. The URL details are then passed to the
JstlView instance through setter injection. The logical view name is usually supplied by
the page controller, as shown in Listing 3-11.
Listing 3-11.
public class PolicyDetailsController implements Controller {
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception {
return new ModelAndView("policydetails");
Finally, the page controller and view resolver should be configured in the Spring
application context so that the dispatcher servlet can use them. Listing 3-12 shows the
Spring configuration.
Listing 3-12. insurance-servlet.xml
<bean name="/"
<bean id="viewResolver" class="org.springframework.web.servlet. å
<property name="basename" value="insurance-views"></property>
Search WWH ::

Custom Search