我想在我的Spring-MVC中为登录和注销页面创建具有不同角色的不同用户名 .
我从下面链接研究过,我使用的是 spring 4.2.5:
http://www.raistudies.com/spring-security-tutorial/role-based-spring-jsp-taglibs/
但我的一个 class 显示错误:
public class AjaxAuthenticationProcessingFilter extends
UsernamePasswordAuthenticationFilter {
@Override
protected void successfulAuthentication(HttpServletRequest request,
HttpServletResponse response, Authentication authResult)
throws IOException, ServletException {
super.successfulAuthentication(request, response, authResult);
}
}
Eclipse shoeing编译时方法错误
AjaxAuthenticationProcessingFilter类型的方法successAuthentication(HttpServletRequest,HttpServletResponse,Authentication)必须覆盖或实现超类型方法
和其他错误是当我调用超级 super.successfulAuthentication(request, response, authResult);
的 successfulAuthentication
方法时 .
您可以看到下面给出的错误:
AbstractAuthenticationProcessingFilter类型中的方法successAuthentication(HttpServletRequest,HttpServletResponse,FilterChain,Authentication)不适用于参数(HttpServletRequest,HttpServletResponse,Authentication)
如果有人知道 spring 安全的任何链接以实现具有不同角色的不同用户,那么请在spring-xml配置的帮助下告诉我 .
1 回答
尝试以下代码..检查您的导入 .
And Mainly
已弃用 .
Use
最后,