On Tue, 17 Apr 2001, David M. Rosner wrote:

> Hi All,
>
> For some reason I can't get the Referer header field from any of my JSP
> pages. I'm using the following code:
>
> String strReferringURL = request.getHeader( "referer" ) ;

Is that the only named you tried?  Capitalization and/or the exact
spelling/name might make a difference.  For example, try "Referer".
You might also check the archives to see what people have to say about
it.

> I also tried looking at all of the headers in the request, but it doesn't
> look like this is including all of the headers:
>
> for (Enumeration e = request.getHeaderNames() ; e.hasMoreElements() ;) {
>           Log.getInstance().logError( (String) e.nextElement() );
> }
>
> Is this because my browser is not sending all of the fields (including
> referrer), or could it be the way that I have Tomcat configured?

A long long time ago in a galaxy far far away (i.e. a different
servlet engine/container) I ran into the situation that getHeaderNames
only returned a hard-coded set of headers, not all headers actually in
the request (so I could getHeader a header that wasn't shown in
getHeaderNames) -- this was something that had to be done because of
the way this information was transferred from the web server to the
servlet engine/container.  I don't know if this is still the case.
But try alternatives for "referer" (and/or check the archives), and
see if that helps.

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

Reply via email to