Discover spring boot mongodb example, include the articles, news, trends, analysis and practical advice about spring boot mongodb example on alibabacloud.com
Spring boot thymeleaf Template engine simplest output exampleThe controller code is as follows:@GetMapping (value = "/test")Public String test (model model) { List Boy.add (New Boy ("XX", 11)); Boy.add (New boy ("yy", 22)); Boy.add (New Boy ("ZZ", 33)); Model.addattribute ("Boy", boy); return "hellohtml";}The template code is as follows:
, improve the DB access speed
Jooq's support
For Redis, lettuce is introduced by default, replacing the previous Jedis as the underlying Redis link
Mongodb\hibernate optimization
Thymeleaf 3Spring Boot 2 supports Thymeleaf 3,thymeleaf 3 compared to Thymeleaf 2 performance boost is not a little bit, because the performance of 2.0 is really not well, but also the use of a new page parsing sys
directly in Main, then the following plugin must be added, otherwise it will not start. This configuration is not required if you are using Maven's spring-boot:run. (When I'm testing, I run it directly in main if I don't configure the following plugin.) )
the coding of 1.6Hello
The fourth step, the real program begins, we need a startup class, and then in the start class declaration let springboot automatically give us the configuration that
framework
Jsonassert: A library of assertions for JSON
Jsonpath:json XPath Library
We only need to introduce the dependency package into the project spring-boot-start-test , we can test the database, Mock, the Web and so on.Spring Boot test contains a variety of test scenarios that we need to use to meet the testing needs of our daily projects.Sprin
-service is suitable, single jar package deployment and management are very convenient. As long as the system architecture design is reasonable, large-scale projects can be used, coupled with nginx load balancing, easy to achieve horizontal expansion;spring bootTo solve the problem, thin provisioning is on the one hand, and on the other hand how to easily spring integrate the ecosystem and other toolchain (
framework
Jsonassert: A library of assertions for JSON
Jsonpath:json XPath Library
We only need to introduce the dependency package into the project spring-boot-start-test , we can test the database, Mock, the Web and so on.Spring Boot test contains a variety of test scenarios that we need to use to meet the testing needs of our daily projects.Sprin
see the monitoring information for a particular example.Sample codeEmail alertsSpring Boot Admin Shows all the application information in the micro-service in the background, so it is very convenient for us to monitor and govern the micro-service overall. But our operators are not able to stare at the background 24 hours a day, so if the service is abnormal, there is a corresponding message alarm is too good, in fact,
: spring boot contains a lot of starter modules, simply put, each starter module is a series of dependent package combinations. The Starter-web module, for example, is a common dependency package that includes some of the spring boot predefined web development, supporting fu
Spring Boot boot process
The Spring Boot series-5 minutes to build an app-explains how to quickly create a spring boot project and run it. Although the steps are simple and the develope
://image.uc.cn//s/wemedia/s/upload/2017/ 53a906b18e4073aec300ce79f084d340x1246x631x25.png "alt=" 53a906b18e4073aec300ce79f084d340x1246x63 "/>DescriptionThe 1 indicates:When the user name, password exists, from the session to get the user really need to go to the page, and then through the redirect to the corresponding pageThe 2 indicates:The login page that jumps directly when the user is not logged in.To run the project:The direct access hijsp path is not logged in and is redirected to the logi
Say in front:
The spring boot has also been a preliminary understanding, but spring boot is also a lot of application module POM configuration, and so on a series of things, need to remember
Make a record so you can look back when you don't remember.
1. Spring
Nginx related information, restart.
2, install Mysql, configure the character set time zone and other information, restart, and finally initialize the script.
3, start the Spring boot project, the overall test of the joint adjustment.
You see I only wrote three lines, but actually build these environments when it is very troublesome, but this is not the end, in the use of a period of time need
. Spring data Repository Style Spring Data provides a Repository abstraction that greatly reduces the similarity of duplicate code in the data access layer. Basic DAO will be implemented, Find,findall, FindByID, save, Delete,update and other methods, and the code logic is basically consistent. Spring data provides a simplified method by which the interface defin
environments before?
1, install Nginx, configure Nginx related information, restart.
2, install Mysql, configure the character set time zone and other information, restart, and finally initialize the script.
3, start the Spring boot project, the overall test of the joint adjustment.
You see I only wrote three lines, but actually build these environments when it is very troublesome, bu
add the message Converter's @bean to the spring container in the @configuration class, and it will be automatically added to the container by spring boot.code example:
@Bean public Stringhttpmessageconverter Stringhttpmessageconverter () { stringhttpmessageconverter converter = new Stringhttpmessageconverter ( charset.forname ("UTF-8
://image.uc.cn//o/wemedia/s/upload/2017/ 2ff5df82a80104a8e9c46476bcdd3332x996x519x15.png;,3,jpegx;3,700x.jpg "alt=" 2ff5df82a80104a8e9c46476bcdd3332x996x519 "/>So what if we want to define ourselves?Remember the global configuration you learned before?650) this.width=650; "Src=" http://image.uc.cn//o/wemedia/s/upload/2017/ 21f59b3361cbc0ea507f04c380e78a31x510x98x4.png;,3,jpegx;3,700x.jpg "alt=" 21f59b3361cbc0ea507f04c380e78a31x510x98x "/>In the global configuration file, we can customize the pre
framework
Jsonassert: A library of assertions for JSON
Jsonpath:json XPath Library
We only need to introduce the dependency package into the project spring-boot-start-test , we can test the database, Mock, the Web and so on.Spring Boot test contains a variety of test scenarios that we need to use to meet the testing needs of our daily projects.Sprin
annotation, is to identify a control, Rescontroller is the collective of @controller and @responsebody.The role of Responsebody again: @responsebody means that the return result of the method is written directly to the HTTP response body. Typically used when retrieving data asynchronously, after using @requestmapping, the return valueusually resolves to the jump path, plus @responsebody after the return result will not be resolved to the jump path, but directly written to the HTTP response body
picture description650) this.width=650; "src=" Http://www.kaigejava.com/res/plugins/ueditor/themes/default/images/spacer.gif "alt=" Spacer.gif "/>Explanation of @EnableAutoConfiguration notes:View source code and notes for this note:650) this.width=650; "Src=" http://image.uc.cn//s/wemedia/s/upload/2017/ Bb26c88b847889617d74d3592170178dx1863x781x58.png "alt=" bb26c88b847889617d74d3592170178dx1863x78 "/>Please click here to enter the picture description650) this.width=650; "src=" Http://www.kaig
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.