Версия: Spring Security 4.2.3
Мне нужны некоторые дополнительные значения, такие как «Form Action» со страницы входа в систему Jsp.Можно ли получить компонент формы "logonForm" в пользовательских SuccessHandler или FailureHandler.Я попытался Autowired, и это не помогло.Есть предложения?
Пользовательский логин JSP
<form:form action="userLogon" commandName="logonForm" >
<input type="hidden" name="action" id="action"/>
FailureHandler
public class MyAppAuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler {
private RedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
@Autowired(required=false)
@Qualifier("logonForm")
private LogonForm logonForm;
@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
AuthenticationException authException) throws IOException, ServletException {
setUseForward(true); // ensure it is a server forward than client redirect
if (authException != null) {
String userId = logonForm.getUserId();