【问题标题】:Spring STS jpa + security + webSpring STS jpa + 安全 + 网络
【发布时间】:2016-06-06 16:17:09
【问题描述】:

我使用选项 jpa,security,mysql,web 启动了 Spring starter 项目

我添加了 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 中收到此消息

“이페이지를 보려면, localhost:8080에 있는 ‘春天’ 영역에 로그인해야 합니다。”

이름:

암호:

这条消息是韩文,意思是

"要查看此页面,您需要在 localhost:8080 中登录 'Spring'"

ID:

密码:

和下一张图片一样,我收到 401 错误

401 error image

如果我需要 URL '/',我认为是 404,但我得到 401 错误

我该如何解决这个问题??

【问题讨论】:

    标签: java spring spring-mvc jpa spring-security


    【解决方案1】:

    在您的构建文件中删除 Spring 安全性,即在您的 pom.xml 中,因为 Spring Boot 自动配置 Spring 安全性。

    您应该删除 pom.xml 中的 Spring Security 工件

    或者你应该实现Spring安全登录(至少在内存认证中)

    【讨论】:

    • @김명준 如果对您有帮助,请点击答案旁边的右标记将此标记为答案,以便对其他人有所帮助
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-18
    • 2018-07-11
    相关资源
    最近更新 更多