I have been trying to get the URL which was typed wrongly by user before redirection to the custom error page.
Below is what I have but I don't see a way to get the wrong
URL from the request
variable
@RequestMapping(value = "/errors/404.html")
private String defaultPage(HttpServletRequest request,Exception e){
request.getRequestURL().toString(); // this prints /error/404.html
...
...
}
I expect to see URL something like www.example.com/home2
which was keyed in by the user. However when I debug I can see the following
How do I retrieve the /home2
from the request ?