I'm redirecting 404 errors to a servlet via the following in my web.xml.
<error-page>
<error-code>404</error-code>
<location>/notFound.do</location>
</error-page>
I'd like to log where the request was trying to go, but I'm not getting it from the referrer header: request.getHeader("referer")
That shows 'null' if I just hit any old random non-existent page.
And request.getRequestURL()/request.getRequestURI() both merely shows the final landing servlet info (I.e., /notFound).
Any way to get the 'bad' page URL that was requested?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…