继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

springBoot 快速搭建启动项目

麦芽2
关注TA
已关注
手记 1
粉丝 3
获赞 50

首先说明一下springboot是什么吧!spriangboot是spring独立出来的项目,用于快速搭建服务项目。引用springBoot自己的话:‘’Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run". We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need very little Spring configuration.“

  1. springboot地址:http://projects.spring.io/spring-boot/
    2、需要下载相应依赖包;
    废话不多说,上demo

```@SpringBootApplication
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
@ImportResource({"classpath:/applicationContext.xml"})
public class Application extends SpringBootServletInitializer{
@RequestMapping("/")
String home() {
return "Hello World!";
}

@RequestMapping("/now")
String hehe() {
    return "现在时间:" + (new Date().toLocaleString());
}

public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
    System.out.println(2);
}

ok,这样就可以启动项目了,直接http:localhost:8080,访问即可!
打开App,阅读手记
11人推荐
发表评论
随时随地看视频慕课网APP

热门评论

喜欢就行过得刚收拾完

查看全部评论