gpt4 book ai didi

java - 我可以使用 and at the same time in spring security

转载 作者:行者123 更新时间:2023-12-01 15:32:45 26 4
gpt4 key购买 nike

有人知道我可以在 spring security.xml 中同时使用 and 吗?目前,我在 xml 中的标签下使用 UsernamePasswordAuthenticationFilter 。但是当我将自动配置设置为“true”并将 @Secured("ROLE_ADMIN") 放入 Controller 类中时,我遇到了异常,例如期望构造函数或参数没有方法。

如何解决这个问题?谢谢

最佳答案

忘记使用自动配置。这带来的麻烦多于其值(value)。只需手动添加您想要的配置元素即可。

如果您收到有关没有 null 构造函数的错误,则 this大概就是这个原因。不过,请务必发布您的异常(exception)情况。

关于java - 我可以使用 <http :auto-config=true> and <UsernamePasswordAuthenticationFilter> at the same time in spring security,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9379575/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com