Java Reference
In-Depth Information
19. <beans:bean
20. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
21. <beans:property name="prefix" value="/WEB-INF/views/" />
22. <beans:property name="suffix" value=".jsp" />
23. </beans:bean>
24. </beans:beans>
Line 12 : <context:component-scan> of the dispatcher servlet registers @
Controller -annotated classes as beans. The BookListController class is
automatically discovered and registered as a bean.
Working with Forms Using Annotations
Form processing is greatly simplified with annotations-driven configuration in Spring Web MVC.
Spring removes the need for traditional form handling via the data binding mechanism that
automatically populates Java objects from the submitted form and by supporting validation and
error reports. Listing 5-46 demonstrates using a form and then processing the user-entered data.
Figure 5-21 illustrates the new files added to the bookstore directory structure.
Figure 5-21. New files in the application for form processing
 
Search WWH ::




Custom Search