當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
SpringSecurity集中式整合之加入jsp
生活随笔
收集整理的這篇文章主要介紹了
SpringSecurity集中式整合之加入jsp
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
整合認證第二版
加入jsp,使用自定義認證頁面
說明
SpringBoot官方是不推薦在SpringBoot中使用jsp的,那么到底可以使用嗎?答案是肯定的!
不過需要導入tomcat插件啟動項目,不能再用SpringBoot默認tomcat了。
我們不能 通過啟動類的方式來進行啟動了,因為它會不識別Jsp頁面,必須導入jar包,然后更換方法
導入SpringBoot的tomcat啟動插件jar包
<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>加入jsp頁面等靜態資源
在src/main目錄下創建webapp目錄
這時webapp目錄并不能正常使用,因為只有web工程才有webapp目錄,在pom文件中修改項目為web工程
這時webapp目錄,可以正常使用了!
修改login.jsp中認證的url地址
修改header.jsp中退出登錄的url地址
總結
以上是生活随笔為你收集整理的SpringSecurity集中式整合之加入jsp的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 集中式整合之加入springsecuri
- 下一篇: SpringSecurity加密认证