SpringBoot创建简单web应用

因为以前就是用JSP页面写的,在这里想转成SpringBoot项目,所以就用了 JSP模板,没有用SpringBoot推荐的template模板

这里用JSP的话需要注意几点:

1:pom,xml  应该用war类型

<groupId>com.hdys.www</groupId>
<artifactId>YSHD</artifactId>
<version>0.0.1-SNAPSHOT</version>

<packaging>war</packaging>

2:添加几个依赖

<!-- 使用JSP -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>

</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>

</dependency>



项目结构:







运行后:




后续再补充。。。。。。。

猜你喜欢

转载自blog.csdn.net/carrybest/article/details/79772246
今日推荐