.
@ EnableAutoConfigurationWith @ Import (EnableAutoConfigurationImportSelector. class), The META-INF/spring. factories will be scannedAll org. springframework. boot. autoconfigure. EnableAutoConfiguration. For further scanning.
Complete.
mvn clean install
Create a new project. Introduce the package project
@Autowired private StringRedisTemplate redisTemplate;
That's easy.
Most of the time we want to expan
Classes that overwrite Auto-configuration
Dynamic configuration with external properties "this article"
Customizing the Error page "second article"
The automatic configuration of Spring boot can save a lot of uninteresting configuration work, but not all automatic configuration can meet the requirements. For example, when you link a database, you nee
This section will delve into the details of spring boot to learn the main features of the spring boot that you want to use or customize.1. SpringapplicationThe Springapplication class provides a convenient way to guide a spring application, which is opened from the main meth
Spring Boot series (11) Spring Boot log Control
This article describes spring Boot log control, which requires a complete video tutorial of Springboot, click here.
Spring
Configuration is one of the key cores of the spring framework, so the spring application will certainly need to be configured to run normally, but the use of spring Boot after a lot of configuration is not done, then auto-configuration exactly how it happened? What is the order and procedure of the occurrence? How did
It is believed that many developers who have used spring know that spring provides a very useful JavaMailSender interface for sending mail. An automated configuration is also provided for this in the Spring Boot starter module. Here's an example of how to use Send mail in
dependencies between the application libraries. This means that if you create a project with a specific Spring IO version, you no longer need to define the version of the library. Even the spring boot startup Project is part of this spring IO. For example, if you are using
environment is not run up. So you spend a lot of time looking for it, and finally find out that there is a problem with a parameter or a comma, or the system kernel version is inconsistent, or you don't understand why! You can only switch to another server, so using Docker is a perfect escape from these pits.All right, no more nonsense, let's get started!Spring Boot CaseFirst we prepare a
is being modified, and the document and code are in two different mediums, which can easily lead to inconsistencies unless there is a strict management mechanism.
To solve this problem, this article introduces the Swagger2 partner of the RESTful API, which can easily be integrated into spring boot and organize a robust RESTful API document with the Spring M
1, SPRINGMVC automatic configuration of official documents
Spring Boot Official Documentation: SPRINGMVC configuration document in spring boot
2. Spring MVC auto-configuration
Spring Boot
need to learn how to use Spring-boot, content reference website and online information (http://projects.spring.io/spring-boot/).Here is the table of contents:Spring-boot Getting Started Spring-
When we are doing Web applications, it is very common for errors to occur during request processing. Spring Boot provides a default mapping: When an exception is thrown in processing, it is /error forwarded to the request for processing, and the request has a global error page to display the exception content.Choose a previously implemented web App (Chapter3-1-2) to start the app, access a nonexistent URL,
For example, if we were to introduce support for Web MVC in spring boot, we would usually introduce this module spring-boot-starter-web, which, if unpacked, would find nothing in it and only defined some pom dependencies.After study, starter is mainly used to simplify the us
;}// ...public void Example () {DB db = Mongo.getdb ();// ...}}
You can change the URL by setting Spring.data.mongodb.uri, or specify a host/port. Set the following properties in Application.properties:
Spring.data.mongodb.host=mongoserverspring.data.mongodb.port=27017
Note: If Spring.data.mongodb.port is not specified, the default port of 27017 will be used. You can simply remove this line from the example
Spring Boot series (10) Spring Boot integrated elasticsearch full-text search engine
This article introduces spring boot integration elasticsearch full-text search engine, need springboot actual combat full video tutorial, click
parameters 8) Jndi Properties in Java:comp/env 9) Java System Properties, i.e. system.getproperties () 10) operating system environment variables One) Randomvaluepropertysource, only attributes in random.* Profile-specific application properties outside the jar package, such as application-(Profile). Properties and Yaml variants Profile-specific application properties within the jar package, such as Application.properties and YAML variants ) application properties outside the jar package, such
Tags: project start ATI group New request Web real default file configurationSpring Boot CaseFirst we prepare a spring boot using MySQL small scene, we do such an example, using Spring boot to do a WEB application, provide a metho
Spring Boot series (13) Spring Boot send mail
This article describes the spring Boot send mail needs springboot combat full video tutorial, click here.
The spring framework uses the J
I. Adding a REDIS cache 1. Adding Redis start-up dependenciesAdd spring boot support for Redis dependency configuration in Pom.xml, as follows: org.springframework.boot spring-boot-starter-redis 1.4.7.RELEASEHttps://mvnrepository.com/artifact/org.springframework.boot/sprin
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.