SpringBoot 添加JSP 支持并附帶在IDEA下創(chuàng)建JSP文件【測試無誤】
更新時間:2018年05月25日 11:01:08 作者:生活歷程
這篇文章主要介紹了SpringBoot 添加JSP 支持并附帶在IDEA下創(chuàng)建JSP文件的相關(guān)知識,感興趣的朋友跟隨腳本之家小編一起學(xué)習(xí)吧
1添加 maven依賴
<!-- tomcat , jsp 的支持 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> </dependency>
2查看pom.xml 中
spring-boot-starter-parent
如果版本是大于1.4的版本 application.properties 添加
# 頁面默認前綴目錄 spring.mvc.view.prefix:/static/jsp/ # 響應(yīng)頁面默認后綴 spring.mvc.view.suffix:.jsp
注意: 在pom文件中 boot 官方模板thymeleaf的依賴 與 jsp的依賴 不可共存
附:
在IDEA中添加JSP文件
總結(jié)
以上所述是小編給大家介紹的SpringBoot 添加JSP 支持并附帶在IDEA下創(chuàng)建JSP文件【測試無誤】,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
相關(guān)文章
關(guān)于Spring?Cloud實現(xiàn)日志管理模塊
這篇文章主要介紹了關(guān)于Spring?Cloud實現(xiàn)日志管理模塊問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2022-11-11