天天看點

springboot 釋出jar中使用jsp做頁面

pom檔案中:

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>1.4.2.RELEASE</version>
                <configuration>
                    <fork>true</fork>
                </configuration>
            </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>
                <filtering>false</filtering>
                <includes>
                    <include>**/**</include>
                </includes>
            </resource>
        </resources>
    </build>      
spring:
  mvc:
    view:
      prefix: /WEB-INF/jsp/
      suffix: .jsp
    throw-exception-if-no-handler-found: true
    static-path-pattern: /static/**
  resources:
    static-locations: classpath:/static/      

繼續閱讀