I'm not sure this will work in all cases, since there are conditions when a client is not supposed to send the referer header. Also, if your URI is hitting a
servlet or if you're using a framework such as
Struts, the JSP URI is obscured and I doubt the referer header will be of any use.