pom.xml 4.0.0 com.luo.demo demo 1.0-SNAPSHOT jar org.springframework.boot spring-boot-starter-parent 1.5.6.RELEASE UTF-8 org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-maven-plugin Application.java @Sp
Application.java4.0.0 com.luo.demo demo1.0-SNAPSHOT jar org.springframework.boot spring-boot-starter-parent1.5.6.RELEASE UTF-8 org.springframework.boot spring-boot-starter-weborg.springframework.boot spring-boot-maven-plugin
@SpringBootApplication
public class Application {
public static void main(String[] args) throws InterruptedException {
SpringApplication.run(Application.class, args);
}
}
IndexController.java
@RestController
@RequestMapping("/")
public class IndexController {
@GetMapping("/")
public String index() {
return "hello world";
}
@GetMapping("/hello/{msg}")
public String hello(@PathVariable("msg") String msg) {
return "hello " + msg;
}
}
