我正在开发一个Spring安全项目,如果User插入了错误的userId - 密码,网页将更新为“Invalid Login Attempt”消息。
我在AuthenticationFailureHandler.onAuthenticationFailure上发送重定向
onAuthenticationFailure()实现的代码片段。
@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
AuthenticationException exception) throws IOException, ServletException {
//some logic
response.sendRedirect(String.format("%s?error", getUrl());
}
}
资源Html页面具有与thymeleaf依赖关系的div标签,以识别error
对象和显示消息
<div th:if="${error}" id="loginFailedMessage" class="alert alert-danger">
Invalid login attempt.
</div>
到目前为止,此实现适用于Jboss应用程序服务器和WebLogic应用程序服务器 - 但不适用于websphere。是否有理由阻止这样的url调用 - 我缺少任何配置。我已经厌倦了不同版本的WebSphere 8.5.5.9,最高可达8.5.5.13
PS。任何日志ffdc或应用程序日志中都没有错误。