在虚拟机上已经配置好tomcat MySQL容器,用sqllog连接MySQL,导入项目的sql文件,在IDEA上进行spring boot的演示。
创建一个Controller来演示Spring Boot
package com.funtl.hello.spring.boot.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@GetMapping(value = "/")
public String hello() {
return "Hello Spring Boot.";
}
}
启动 HelloSpringBootApplication 的main方法
浏览器访问 http://localhost:8080 即可得到返回内容
来源:CSDN
作者:爱爱爱爱五月天
链接:https://blog.csdn.net/qq_43072699/article/details/103497136