I captured an URL:(example)
In a variable in my .jsp, then I have to log in and in the back, after validating that the login was correct, I'm redirecting the page to the home of my application but what I want is to redirect it the URL that I captured before login in. Is there a way to capture that variable in the back when its about to redirect? Like calling a function in front from the back so that it returns the URL?
This is the function from where I redirect:
protected void handle(HttpServletRequest request,
HttpServletResponse response, Authentication authentication) throws IOException {
var urlNew = functionToCaptureURL();
redirectStrategy.sendRedirect(urlNew);
//redirectStrategy.sendRedirect("https://lol.com/home");
}