1.创建maven工程,导入依赖<br /><br /><parent><br /> <groupId>org.springframework.boot</groupId><br /> <artifactId>spring-boot-starter-parent</artifactId><br /> <version>1.5.10.RELEASE</version><br /></parent><br /><br /><dependencies><br /> <dependency><br /> <groupId>org.springframework.boot</groupId><br /> <artifactId>spring-boot-starter-web</artifactId><br /> </dependency><br /></dependencies><br /><br />2.创建项目启动类
@SpringBootApplication<br />public class Application {<br /> public static void main(String[] args) {<br /> SpringApplication.run(Application.class, args);<br /> }<br />}<br /><br />3.创建controller@RestController<br />public class HelloController {<br /><br /> @GetMapping(value = "/hello")<br /> public String hello(String name){<br /> return "hello " + name;<br /> }<br />}<br /><br />4.运行第2步中的main方法启动项目,浏览器访问:http://localhost:8080/hello?name=world