1、使用idea创建spring boot项目
2、添加spring-boot-starter-web依赖
3、启动spring boot项目,浏览器直接访问8080端口,访问路径为"/"
4、修改配置文件application.properties
5、添加server.servlet.context-path=/hello,代表访问路径为"/hello"
6、重启项目,如下图所示
时间:2024-10-13 15:23:05
1、使用idea创建spring boot项目
2、添加spring-boot-starter-web依赖
3、启动spring boot项目,浏览器直接访问8080端口,访问路径为"/"
4、修改配置文件application.properties
5、添加server.servlet.context-path=/hello,代表访问路径为"/hello"
6、重启项目,如下图所示