SpringBoot系列一:maven方式构建项目
SpringBoot系列一:maven方式构建项目
一、目录结构
二、HelloWorldSpringbootApplication
package com.bigdata.learn;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class HelloWorldSpringbootApplication {
public static void main(String[] args) {
SpringApplication.run(HelloWorldSpringbootApplication.class,args);
}
}
三、HelloWorldController
package com.bigdata.learn.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloWorldController {
@RequestMapping("/hello")
public String hello(String name){
return "hello springboot";
}
}
四、运行程序
版权声明:本文为zhengzaifeidelushang原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。