I have the following controller:
@Controller
public class MyErrorController implements ErrorController {
@RequestMapping("/error")
public String handleError(HttpServletRequest request, Model model) {
Object url = request.getRequestURL()
model.addAttribute("url", url)
return "404";
}
}
However, the above url always gives me the url "/error", even if the user has went to the page "http://mywebsite.com/does-not-exist". How would I retrieve the url as entered in by the user before generating the error page?