Today finally put SPRINGMVC study guide This book finished, write down this blog record.
Paired with SPRINGMVC environment
Step one: Add Dispatcherservlet to the Web. xml file, which I understand is to dispatch the action allocator with @controller annotations
Step Two: Initialize the springmvc.xml path
Step three: Map all URLs to the servlet by configuring the Url-pattern element
Fourth Step: Configure the path of the JSP file, with the suffix
The fifth step of the:<annotation-driven> element includes registering the Bean object that is used to support the request processing method of the annotation-based controller. The <resource> element indicates SPRINGMVC which static resources need to be handled separately (not through Dispatcherservler)
It should be noted that if there is no <annotation-driven>,,<resource> will prevent any controller from being called.
Sixth step: Spring uses the scanning mechanism to find all the annotation-based controller classes in the application.
================================================================================
@Autowired for annotation service in the Controller class, @Service implementation class for the annotation service
SPRINGMVC Study Guide