Skip to main content

Simple SpringBoot example

Mr.ChenLess than 1 minutearticleJavaSpring Boot

Spring Boot
Spring Boot

Since my friend rewrote the code, it took him more than an hour to get started quickly and build a simple springboot application. Finally, he finished writing a simple springboot-demo and started it directly on eclipse. Now share it with A friend in need. See the source code address at the end of the article, the operation steps are as follows:

  1. Copy the settings.xml file in the maven directory to the .m2 directory in the user directory (eg: C:\Users\Think.m2\settings.xml)

  2. Click the menu File->Import->Existing Maven Projects in eclipse, and select the code directory.

  3. Execute the table creation statement in the sql directory in the database.

  4. Open the project in eclipse and modify the database connection information in application.properties.

  5. Right-click the SpringbootDemoApplication.java file and select Run As -> Spring Boot App.

  6. After successful startup, visit http://localhost:8080/get-by-email?email=c@c.com on the browser

Github address: https://github.com/chcbz/springboot-demoopen in new window

Make up the word count series:

Spring Boot is a new framework provided by the Pivotal team, which is designed to simplify the initial construction and development process of new Spring applications. The framework uses a specific approach to configuration, so that developers no longer need to define boilerplate configuration. In this way, Spring Boot aims to be a leader in the burgeoning field of rapid application development.

Features:

  • Create standalone Spring applications

  • Embedded Tomcat, no need to deploy WAR file

  • Simplified Maven configuration

  • Automatically configure Spring

  • Provides production-ready features such as metrics, health checks, and external configuration

  • Absolutely no code generation and no configuration requirements for XML