SpringBoot首个配置示例如何编写?
- 内容介绍
- 文章标签
- 相关推荐
本文共计213个文字,预计阅读时间需要1分钟。
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 @SpringBootApplication
jar
UTF-8
@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; } }
本文共计213个文字,预计阅读时间需要1分钟。
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 @SpringBootApplication
jar
UTF-8
@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; } }

