网站制作推广需要多少钱,免费推广自己的网站,专业全网推广建站公司,深圳居家办公最新通知目录
新建Maven工程#xff0c;什么都不选
pom.xml加上
新建包top.cjz.controller 新建类HelloController
新建类HelloApplication
运行浏览器访问 新建Maven工程#xff0c;什么都不选 pom.xml加上 !--springboot工程需要继承的父工程-- parent…目录
新建Maven工程什么都不选
pom.xml加上
新建包top.cjz.controller 新建类HelloController
新建类HelloApplication
运行浏览器访问 新建Maven工程什么都不选 pom.xml加上 !--springboot工程需要继承的父工程-- parent groupIdorg.springframework.boot/groupId artifactIdspring-boot-starter-parent/artifactId version2.1.8.RELEASE/version /parent dependencies !--web开发的起步依赖-- dependency groupIdorg.springframework.boot/groupId artifactIdspring-boot-starter-web/artifactId /dependency /dependencies 新建包top.cjz.controller 新建类HelloController package top.cjz.controller;import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;RestController
public class HelloController {RequestMapping(/hello)public String hello(){return Hello SpringBoot;}
}新建类HelloApplication package top.cjz;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;SpringBootApplication
public class HelloApplication {public static void main(String[] args) {SpringApplication.run(HelloApplication.class,args);}
}运行浏览器访问