如何在自定义错误页面上获取请求的URL

SiM*_*Met 7 spring

我的应用程序遇到了下一个问题.我必须创建自己的404页面,我想在那里写"找不到页面{requestedPage}",但我不知道如何获得这个值.

我用RequestMapping创建了Controller

@RequestMapping("404")
public String handle404(Locale locale, Model model ,HttpServletResponse response, HttpServletRequest request){
    ...
}
Run Code Online (Sandbox Code Playgroud)

并在web.xml中将此页面设置为404错误页面

<error-page>
    <error-code>404</error-code>
    <location>/404</location>
</error-page>
Run Code Online (Sandbox Code Playgroud)

我在春季论坛上发现了同样的问题 http://forum.springsource.org/showthread.php?87670-Knowing-the-requested-URL-during-a-404 但没有答案

我查找了所有HttpSerletRequest方法和字段,但找不到任何有用的东西.

有谁知道如何做到这一点?