Spring boot quick start


What is a springboot?

1. Do you need to import many dependencies when developing with SSM?
2. The dependency of introducing SSM is tangled. Is the version compatible?
3. The configuration file is scattered in multiple places, and the modification is cumbersome?
4. Write the basic configuration repeatedly every time you create a new project? Try springboot! This framework is the result of liberal arts and science solving the above problems! Of course, it has more advantages. Let’s have a look!

Second, start with a hello world project

1. Open idea, create a maven project, and select the web app skeleton
2. Improve the directory structure, add folders such as Java resource, and complete the folders of the three-tier architecture (Controller Service Dao / mapper)
3. In POM Add the following content to the XML

#If you want to specify the JDK version


#The following dependency is the official initiator dependency of springboot. In the future, many similar initiators will look like this. Because we specify the parent project above, springboot will automatically help us manage the version without writing the version number of these dependencies


4. Go back to the Java folder and write the startup class

Write the applicatiton startup class in the Java folder

package com.yang;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

  • Project entrance
  • */

public class Application {

public static void main(String[] args) {


5. Write a hellocontroller in the controller

package com.yang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

public class HelloController {

public String Hello (){
    return "<h1>Hello I Am Yang </h1>";


6. Just run it in the application class
    Enter localhost: 8080 / hello in the browser
    You can witness miracles