0
我運行一個代碼,就像登錄:春季安全手動重定向(代碼,無需配置)
public String login(String username,String password){
Authentication request = new UsernamePasswordAuthenticationToken(username,password);
Authentication result = authenticationManager.authenticate(request);
SecurityContextHolder.getContext().setAuthentication(result);
return null;
}
我不使用JSF和不知道如何成功登錄後的頁面重定向到請求的安全頁面。
我在使用它時正在獲取facesContext,但現在我沒有使用。
如何通過代碼重定向?