request.getHeader - referer

M

Mark Fitz

Hi,

I am having some basic problems with
request.getHeader("referer");

It produces a null every time I try to link to my page.

I've tried all these
request.getHeader("referer");
request.getHeader("Referer");
request.getHeader("REFERER");

I think it may be due to a resin configuration or something as I
believe the headers are not being set/forwarded corretcly.

Any ideas on a rememdy?

TIA,
Mark.
 
A

Andrew Thompson

request.getHeader("referer"); ....
I've tried all these ...

Stop guessing. Find out what the headers are, using..
HttpServletRequest.getHeaderNames()
 
S

sks

Mark Fitz said:
Hi,

I am having some basic problems with
request.getHeader("referer");

It produces a null every time I try to link to my page.

I've tried all these
request.getHeader("referer");
request.getHeader("Referer");
request.getHeader("REFERER");

Well it's referer lower case.

But it only works if you've clicked a link. If you type something in at the
url bar the referer will always be null.
 
M

Murray

sks said:
Well it's referer lower case.

But it only works if you've clicked a link. If you type something in at the
url bar the referer will always be null.

Or if your browser/firewall chooses not to set the referer header (depending
on security settings)
 
H

hiwa

Andrew Thompson said:
Stop guessing. Find out what the headers are, using..
HttpServletRequest.getHeaderNames()

And referer can be null. If you don't find it in the getHeaderNames()
return value, it is null.

HTTP header name is case insensitive.
 
M

Mark Fitz

Murray said:
Or if your browser/firewall chooses not to set the referer header (depending
on security settings)

Thanks guys, this was indeed the case - I had installed Zone Alarm Pro
(trial)which was screwing up the header information... what a headache
trying to figure this one out!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top