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