First, create the first demo program uses the idea entry tools ----- hello, steps as follows:
Then, write controller class
code show as below:
package com.neo.controlller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@RequestMapping("/")
public String index() {
return "Hello Spring Boot 2.0!";
}
}
Classes start running Access: http://127.0.0.1:8080/
So basically completed!