新建Project 默认选中 Default
点击下图的Next 按钮

填写Group、Artifact
Package 那一栏和Group 保持一致就好,如果是com.jack.springtest的话会导致 WhiteLabel Error Page 异常

选中Web 选项 然后点击Next 按钮

然后点击Finish 按钮

工程结构如下:

在jack package 下新建"controller" package,在controller 下新建TestController.java,并添加如下图中的代码:

此时点击运行按钮

在地址栏输入:http://localhost:8080/hello 会有如下图输出

配置端口号 和 访问路径

再次运行 在浏览器中输入 http://localhost:8081/springboot/hello
会有上面同样的输出。
网友评论