File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes calling web site Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "calling web site" Watch "calling web site" New topic

calling web site

Paul Richards

Joined: Jul 25, 2001
Posts: 19
Here is my problem. I need to determine which web site called ours.
For example if the user did a search in and this provided a link to our website, how could I determine that the previous site was
I need to do this for marketing reasons!!! They want to know who is coming to our site via which search engine.
cheers Paul
Brian Glodde
Ranch Hand

Joined: Jun 27, 2001
Posts: 171
Have a look at the "HTTP_REFERER" field in the HTTP headers via getHeader(String name) in the request object.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
HTTPRequest headers has the Referer header that you can check.

So much trouble in the world -- Bob Marley
Paul Richards

Joined: Jul 25, 2001
Posts: 19
thanks for the replies
I have tried using your suggestion and using the following code
<%String url = new String();
url = request.getHeader("Referer");
I actually got this d122
as the url
This is not what I was quite expecting, have I done something wrong?
thanks in advance Paul
subject: calling web site
It's not a secret anymore!