SpringBoot集成jsp文件上传,部署项目,打包后无法访问jsp页面

一、项目的打包,在pom.xml加入

``
<build>
<finalName>UeditorAndSB</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.2.RELEASE</version>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/webApp</directory>
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
</build>
注意这里的版本必须要1.4.2.RELEASE以下的版本,否则不能支持jsp页面的访问
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.2.RELEASE</version>
</plugin>
二、执行操作开始打包,这里可以是war或者是jar包,但是在pom.xml里必须要制定你需要哪种类型的包,打包后再target下面找到对应的打包文件,上传到服务器上,运行
java -jar 文件名.jar或者是java -jar 文件名.war`
修改位置
这里写图片描述

三、访问项目即可,这里说明,springboot更适合做后端,实现前后端完全分离最合适,如果前后端集合一起有很多坑`这里写代码片`

猜你喜欢

转载自blog.csdn.net/xljx_1/article/details/81565620