exceptionHandler
@exceptionHandler Note: Automatic capture controller specified type layer appear abnormal, and the abnormality corresponding exception handling
HttpServletRequest
Request on behalf of clients by providing a method of this object, you can get all the information requested by the client.
https://blog.csdn.net/jiahao1186/article/details/82026330
Validation rules validator
1 is introduced maven dependent warehouse hibernat-validator
2 Interface package validator
3 validator add annotations on class attributes mdel
Map,StringUtils
1Map: storing data in the form of an interface keys, there HashMap implementation class set, set a LinkedHashMap
https://blog.csdn.net/qq_29373285/article/details/81487594
Operation object 2StringUtils method is an object Java.lang.String type, is a complement of type String method of operation of the JDK, and methods are static, so we can call StringUtils.xxx ()
HTTPS: //blog.csdn .net / weixin_42290280 / article / details / 82591161
springMvc mechanism
1 requests the user request to the front end controller (DispatcherServlet)
2DispatcherServletrServlet request processor mapper (HandlerMapping) lookup processor Handler (Controller)
3handlerMapping processor returns to DispatcherServlet
4DispatcherServlet call processor perform adapter Handler
5handler completed execution returns ModelAndView
6DispatcherServlet call view resolver to render the view will resolve the logical name into the view of the real view (e.g., JSP)
. 7 resolver returns view to view the DispatcherServlet
8DispatcherServlet complete view rendering
9 returns a response
The two most important interfaces are views for processing SpringMVC ViewResolver and View. ViewResolver main role is to view the name of a logical resolves to a true view, SpringMVC for the View object presented to the View client is the object itself, but merely the logical view ViewResolver name resolution View object to object. The main role for processing View interface view, and then returned to the client.
Template engine thymeleaf
The role of template engine is template (page) and data integration and display output
syntax slightly