• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

How do i get URL of the page from where a request is coming- using java

Hi

I have an ads landing page. The link for the landing page will be available as hyperlink in different websites like: www.google.com, www.irctc.co.in, www.ads.com. I have to identify from which website the request is coming from? Based on the Domain name i will have to assign some points:

for example, If someone searches for myads, then my URL will be displayed in Google search results page.

My servlet has to identify that the request is coming from Google site.

I have used request.getXXX method. but i could not get the domain. I am not sure which method of request will provide suitable solution for my requirement?

Thanks
NParamas
0
NParamas
Asked:
NParamas
1 Solution
 
Ryan ChongCommented:
tried use:

request.getHeader("Referer")

?
0
 
jamovilleCommented:
request.getRequestUri
request.getRequestUrl
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now