Summary: Spring MVC workflow Flowchart
Springmvc Work Flow chart
Figure A
Figure II
Development tools
1.Eclipse IDE: Using MAVEN project management, modular.
2. Code generation: Through the interface mode simple configuration, automatically generate the corresponding code, currently includes three ways to generate (add and revise): Single table, one-to-many, tree structure. After the generated code, if you do not need to pay attention to the degree of beauty, after the build can be used.
Technology selection (only part of the technology is listed)
1, back-end
Service Framework: Dubbo, Zookeeper, rest services
Cache: Redis, Ehcache
Message middleware: ActiveMQ
Load balancing: Nginx
Distributed files: Fastdfs
Database connection pool: Alibaba Druid 1.0
Core Framework: Spring framework
Security framework: Apache Shiro 1.2
View Frame: Spring MVC 4.0
Server-side validation: Hibernatevalidator 5.1
Layout frame: Sitemesh 2.4
Workflow Engine: Activiti 5.15
Task Scheduler: Quartz 1.8.5
Persistence Layer Framework: MyBatis 3.2
Log management: slf4j 1.7, log4j
Tool classes: Apache Commons, Jackson 2.2, Xstream 1.4, dozer 5.3, POI
2. Front-end
JS frame: jQuery1.9.
CSS Framework: Bootstrap 4 Metronic
Client authentication: Jqueryvalidation Plugin.
Rich Text: Ckecitor
File Management: Ckfinder
Dynamic tab: Jerichotab
Data table: Jqgrid
dialog box: JQuery jbox
Tree structure controls: JQuery Ztree
Other components: Bootstrap 4 metronic
3. Support
Server middleware: Tomcat 6, 7, Jboss 7, WebLogic 10, WebSphere 8
Database support: Currently only support MySQL database, but not limited to the database, the next version of the upgrade multi-data source switching and database read and write separation: Oracle, SQL Server, H2, etc.
Support development environment: Eclipse, MyEclipse, Ras, idea, etc.
Classic Introduction:
SOURCE structure
Spring Workflow Description
The user sends a request to the server, and the request is captured by the spring front control servelt Dispatcherservlet;
Dispatcherservlet parses the request URL to get the request Resource Identifier (URI). Then, according to the URI, call handlermapping to get all the related objects of the handler configuration (including the handler object and the interceptor corresponding to the handler object), and finally return as a Handlerexecutionchain object;
Dispatcherservlet according to the obtained handler, choose a suitable handleradapter. (Note: If Handleradapter is successfully obtained, the Interceptor Prehandler (...) will start executing. Method
- Extract the model data from the request, populate the handler entry, and start executing the handler (Controller). In the process of populating the handler, depending on your configuration, spring will do some extra work for you:
Httpmessageconveter: Converts a request message (such as JSON, XML, and so on) into an object, converting the object to the specified response information
Data transformation: Data conversion for a request message. such as string conversion to Integer, double, etc.
Data is initialized: Data is formatted for the request message. such as converting a string into a formatted number or a formatted date
Data validation: Verifying the validity of the data (length, format, etc.), and verifying that the results are stored in Bindingresult or error
Handler returns a Modelandview object to Dispatcherservlet when execution is complete;
Based on the returned Modelandview, select a suitable viewresolver (must be viewresolver already registered in the spring container) to return to Dispatcherservlet;
Viewresolver combining model and view to render the view
- Returns the rendered result to the client.
Spring Workflow Description
Why does spring use only one servlet (Dispatcherservlet) to handle all requests?
Detailed view of the Java EE design mode-front-end control mode
Why does spring use handlermapping and Handleradapter to deal with handler?
Conforms to the single-object-oriented principle of responsibility, code architecture is clear, easy to maintain, and most importantly, code reusability is high. such as handleradapter may be used to handle a variety of handler.
Complete project source code Source Welcome to study related technology, source code acquisition please add: 2670716182
Spring MVC principle