one about Port :
The default port for spring boot is 8080, and if you want to change it, make the following configuration in the configuration file. Serverproperties.class will read this value.
Server: 8081
Another way is if you just want to modify the port number when you start it, you can modify the port number with command-line arguments . The configuration is as follows:Java-jar after packaging Springboot.jar--server.port=8000
two @RestController (Spring has another note @Controller)
That is, @restcontroller = @ResponseBody + @Controller combination annotations.
If the name of the logical view is returned and the page needs to be displayed, use @controller with the View Resolver (resolver) to render the page;
If you return JSON directly, you can use the @RestController.
Three @Autowired
This note is that spring can automatically help you omit the Setter/getter method of the object referenced in the Bean , and it will automatically help you set/get.
@Autowired annotation, it can annotate class member variables, methods, and constructors to complete the work of automatic assembly. use the @Autowired to eliminate the set,get method.
When the spring container is started,autowiredannotationbeanpostprocessor will scan all the beans in the spring container when it finds that the Bean has the @ When autowired comments, it finds the Bean that matches it ( by default by type ) and injects it into the corresponding place.
Spring Boot Learning four: Spring boot configuration file application.yml