; @SpringBootApplication @RestController public class application { @RequestMapping ( "/") public String greeting () {return "Hello world!";} public static void main (string[] args) {Springapplication.run ( Application.class, args); }} Run app: mvn spring-boot:run or run Main () method in the IDE, Access http://localhost:8080 in the browser, Hello world! appears on the page. With just more than 10 lines of Java code and a Hello World app ru
Previously wrote some auxiliary work related to how spring boot uses AOP. Here continue to the topic, how to reduce the spring Boot optimistic lock plus lock error situation (basic can be resolved).1. Package dependencies
SPRING-
Configuration.Role Management: Role Menu permission assignment, set role to divide data range permissions by agency.Rights Management: Maintenance of some of the more fixed data used in the system.Menu Management: Configure the System menu, Operation permissions, button permission identification, and so on.Department Management: Configure the system organization, tree structure display, can adjust the subordinate.Log management: The normal operation of the system log records and queries, system
system operator, this function mainly completes the system User Configuration.Role Management: Role Menu permission assignment, set role to divide data range permissions by agency.Rights Management: Maintenance of some of the more fixed data used in the system.Menu Management: Configure the System menu, Operation permissions, button permission identification, and so on.Department Management: Configure the system organization, tree structure display, can adjust the subordinate.Log management: Th
function mainly completes the system User Configuration.Role Management: Role Menu permission assignment, set role to divide data range permissions by agency.Rights Management: Maintenance of some of the more fixed data used in the system.Menu Management: Configure the System menu, Operation permissions, button permission identification, and so on.Department Management: Configure the system organization, tree structure display, can adjust the subordinate.Log management: The normal operation of
Brief introductionDid you retreat from the complex configuration when you first contacted and learned the spring framework for the 1th time? When you use the Spring framework for Nth times, do you feel bored with a bunch of sticky configurations? Try spring boot to make it easier and faster to build your
="]60mb%{(o2a () v{13i7jf_4.png "alt=" Wkiom1k4_0txrdomaadczc7n2tw571.png-wh_50 "/>The default name is example,Let's change it a little bit and change it to demo001650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/98/3C/wKioL1k4_83CU5mcAAEvg3pU1VM053.png-wh_500x0-wm_ 3-wmp_4-s_1563062793.png "title=" Rrra$m ' vmos1@y9kb (PW (2o.png "alt=" wkiol1k4_83cu5mcaaevg3pu1vm053.png-wh_50 "/ >Interface I have changed, may not be the same as the defaul
Spring Boot
Spring Boot is a new framework provided by the pivotal team designed to simplify the initial setup and development of new spring applications. The framework uses a specific approach to configuration, which eliminates the need for developers to define boilerplate
various types of simple additions and deletions, spring data provides a direct query based on the proxy method, nothing needs to do, the only need to write interfaces, naming methods, this part is too convenient, and simple query to solve almost 80% of the problem. This part is relatively simple, do not repeat, refer to the use of the Daquan section.
Because of the implementation of the template DAO, so that the DAO layer of these concrete entities h
The code in the previous section is a starter program for Spring-boot and a program on the official documentation. This section introduces the way in which Spring-boot official documentation is recommended to develop the code and introduces our call to the service layer in spring
Livereload.
The Devtools relies on the closing hook of the application context to close it during a restart. If you disable the close hook (Springapplication.setregistershutdownhook (false)), it will not work correctly.
Devtools automatically ignores the name spring-boot,spring-boot-devtools,
environment
-Application-prod.properties: Production environment
To use the corresponding environment, just use the Spring.profiles.active property in Application.properties to set the value corresponding to the {profile} mentioned above, which refers to the 2 dev, prod.Of course you can also use the command line to start with parameters:I add different port attribute server.port to different environments, and then switch to use according to the different spring.profiles.active specifi
[From] https://www.liaoxuefeng.com/article/001484212576147b1f07dc0ab9147a1a97662a0bd270c20000Spring Boot Configuration multiple datasourceLiaoche/Programming/ 1-13 10:11/read: 14041With spring boot, the configuration is easy by default DataSource . Spring boot will automatic
encoding format
Spring.main.banner-mode=console/off//banner graphics Open or Print mode
2.3 MySQL Data source configuration (introduced SPRING-BOOT-STARTER-JDBC automatic integration)
Annotations use JdbcTemplate or integrated MyBatis (introducing Maven:mybatis-spring-boot-starter)
Spring.datasource.driver-class-name=
The configuration of the data source can be followed by the example of Spring boot Learning (vii) Web applications using the Datasourceconfig implementation of JdbcTemplate multiple data source configuration. Add the JPA configuration for the first data source, note the two notes where you specify the Entity entity and Repository defined location for the data sou
Spring Boot IntroductionSpring Boot is a new framework provided by the Pivotal team designed to simplify the initial setup and development of new Spring applications.
The framework uses a specific approach to configuration, which eliminates the need for developers to define a boilerplate configuration
Us
Article Directory
1. Out of the box, hidden in the mystery
2. Summary
3. Source Code
Spring boot provides a lot of "out-of-the-box" dependency modules, so how does spring boot skillfully do it out of the box and automatically configure it?Out of the box, inside the hidden mysterySpring
Redis
Redis is a cache, Message Queuing, and multiple types of key-value storage services.
Spring Boot
Spring boot provides automatic injection configuration for lettcue and Jedis clients, and provides abstract interfaces through Spring-data-redis
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.