login.jsp ページの非表示の値に基づいてページをリダイレクトしたいのですが、これが私のコードです
public class AuthenticationHandler extends SavedRequestAwareAuthenticationSuccessHandler {
private final String HASH_URL = "hashURL";
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws ServletException, IOException {
super.onAuthenticationSuccess(request, response, authentication);
String hashValue = request.getParameter(HASH_URL);
if(hashValue != null){
if(!hashValue.isEmpty()){
setDefaultTargetUrl("/home/" + hashValue);
}
}
}
}
hashValue が login.jsp ページから最新の値を取得していることがわかりますが、常にサイト /home/ ページを移動しています。これが私の構成です
<security:form-login
login-page="/auth/login"
default-target-url="/home/"
authentication-success-handler-ref="customAuthenticationSuccessHandler"
always-use-default-target="true"
authentication-failure-url="/auth/login?error=true"/>