idea中springboot静态资源及页面跳转问题


1,静态资源放在resources/static下,html页面放在resources/templates下

2,在html中引入静态资源时,不用带static(对于路径来说是透明的)

 

3,

配置html的时候需要使用到其他工具,比如freemarker

spring.freemarker.suffix=.html

spring.freemarker.template-loader-path=classpath:/templates/

pom.xml代码:

 

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

 

 

配置jsp页面的时候使用

spring.mvc.view.prefix=/WEB-INF/

spring.mvc.view.suffix=.jsp

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM