tomcat jsp HTTP_REFER returning null;

K

koshy

I am having a problem where a call to request.getHeader("HTTP_REFERER")
is returning null;
I have tried the following

HTTP_REFERER
Http_Referer
http_referer
REFERER
referer

Is there a solution?
Why is referer always returning null;
On my watch window I cannot find a header with any of the above
headerNames.
How can I find who is the referer?
regards
Koshyh
 
A

Alexander

koshy said:
I am having a problem where a call to request.getHeader("HTTP_REFERER")
is returning null;
I have tried the following

HTTP_REFERER
Http_Referer
http_referer
REFERER
referer

Is there a solution?
Why is referer always returning null;
On my watch window I cannot find a header with any of the above
headerNames.
How can I find who is the referer?
regards
Koshyh

You can get the referrer via

request.getHeader("referer")

However you should note that it isnt a mandatory field and usually only
available if the client sends it at all respectively if the request
originates from a link. Direct requests do not contain a referrer.

Alexander
 
M

Moiristo

Alexander said:
You can get the referrer via

request.getHeader("referer")

However you should note that it isnt a mandatory field and usually only
available if the client sends it at all respectively if the request
originates from a link. Direct requests do not contain a referrer.

Besides, most firewalls automatically remove the referer header. It is
better to find a workaround, like using sessions or something.
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top