本文共 1294 字,大约阅读时间需要 4 分钟。
4.0.0 boo boo 0.0.1-SNAPSHOT jar boo http://maven.apache.org UTF-8 org.springframework.boot spring-boot-starter-parent 1.3.4.RELEASE org.springframework.boot spring-boot-starter-web
package boo.boo;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.EnableAutoConfiguration;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.ResponseBody;@SpringBootApplicationpublic class HelloController { @RequestMapping("/hello") @ResponseBody String home() { return "Hello ,spring boot哈哈!"; } public static void main(String[] args) throws Exception { SpringApplication.run(HelloController.class, args); //运行之后在浏览器中访问:http://localhost:8080/hello } }
转载地址:http://vvcqb.baihongyu.com/