I have the following...
@GetMapping("signup")
public String get(){
return "forward:/";
}
@Override
public boolean preHandle(HttpServletRequest request,
HttpServletResponse response,
Object handler) throws IOException {
...
if(!per.isPresent() && !request.getRequestURL().toString().contains("signup")){
response.sendRedirect("/signup");
return false;
}
}
The problem here is when the forward comes it isn't signup so I redirect back. However, I also want to intercept requests that go directly to the root.
Is there any way to tell if a request is a forward and what the original url was?