簡體   English   中英

Spring STS JPA +安全性+ Web

[英]Spring STS jpa + security + web

我使用選項jpa,security,mysql,web啟動了Spring入門項目

我在代碼中添加了application.properties

spring.jpa.hibernate.ddl-auto=create
spring.jpa.generate-ddl=false
spring.jpa.show-sql=true

spring.datasource.url=jdbc:mysql://kimdg3550.cafe24.com/kimdg3550
spring.datasource.username=kimdg3550
spring.datasource.password=
spring.datasource.driverClassName=com.mysql.jdbc.Driver

如果我轉到URL http:// localhost:8080

我在Mac中收到此消息

“이이이지를보려면,本地主機:8080있는'Spring'그인해야로그인해야다。”

이름:

암호:

這則訊息是韓文,表示

“要查看此頁面,您需要在localhost:8080中登錄'Spring'”

ID:

密碼:

和下一張圖片一樣,我收到401錯誤

401錯誤圖片

如果我需要URL'/',我認為是404,但出現401錯誤

我怎么解決這個問題??

在您的構建文件(即pom.xml)中刪除Spring安全性,因為Spring Boot自動配置Spring安全性。

您應該在pom.xml中刪除Spring Security工件

或者您應該實現Spring安全性登錄(至少在內存身份驗證中)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM