0

我正在寻找如何接收活动/登录用户的正确方法。我将 Spring Security 3.1 与相同版本的 Spring MVC 一起使用。整个想法是基于这篇文章中更多评论的这个主题:

文章中的@ActiveUser 注释

我完全按照说明进行操作,但仍然出现这种错误:

No default constructor found; nested exception is java.lang.NoSuchMethodException: org.springframework.security.core.userdetails.User.<init>()]

在我的 applicationContext.xml 我有这三个注释不是作者直接提出的

<context:annotation-config />
<context:component-scan base-package="my.package.*" />
<mvc:annotation-driven />

什么可能导致这种问题?

4

1 回答 1

1

在互联网上搜索了几个小时后,我发现了我应该如何解决这个问题。因为它可能对其他人有用,所以我提供了解决方案。

这类问题在 Spring 3.1(我使用)中的解决方案与 Spring 3.0(提到的教程)中的解决方案不同。此处介绍了有关该问题的精彩文章:在此处输入链接描述

于 2012-06-16T15:24:13.107 回答