Spring Boot 打jar包 无法响应jsp 问题

  1. <!--增加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>

2.编译插件版本指定1.4.2

<plugin>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-maven-plugin</artifactId>
   <version>1.4.2.RELEASE</version>
</plugin>

3.<!-- 将src/main/webapp下的所有文件文件编译到classes/META-INF/resources下-->

<resource>
   <directory>src/main/webapp</directory>
   <targetPath>META-INF/resources</targetPath>
   <includes>
      <include>**/*.*</include>
   </includes>
</resource>

    4.application 配置

   spring.mvc.view.prefix=/WEB-INF/views/
   spring.mvc.view.suffix=.jsp

  

展开阅读全文

没有更多推荐了,返回首页