I'm looking to find the best way to find the referring page (ie find out where the
user came from). So far this is the piece of code I have...
Enumeration e = request.getHeaderNames();
String refText = null;
while (e.hasMoreElements())
{
String key = (String)e.nextElement();
if (key.equals("referer"))
{
refText = request.getHeader(key);
break;
}
}
I have to imagine that there's a better way to do this..does anyone have any insight?
I checked google and the servlet javadocs and didn't see anything that simplified this
code. Otherwise, I'll just drop this piece of code into a util class. Just seeing if
I'm reinventing the wheel. Thanks.