您的位置:首页 > 编程语言 > Java开发

idea运行第一个springboot项目

2018-01-16 10:02 447 查看
idea自带tomcat,搭建好环境后,直接运行demoApplication,然后在浏览器输入localhost:8080/hello

@SpringBootApplication
public class DemoApplication {

public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}


@RestController
@EnableAutoConfiguration
public class HelloSpringboot {
@RequestMapping("/hello")
public String say() {
System.out.println("Hello springboot");
return "hello,this is a springboot demo";
}
}


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: