Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8484105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:17:16+00:00 2026-06-10T20:17:16+00:00

I may not have framed the query properly. So let me explain the problem

  • 0

I may not have framed the query properly. So let me explain the problem I am facing.

Environment :
I have a server which responds to http API calls. The client making this call, is an html file on another server. So it is a cross domain call. The functionality is working as expected.

Problem :
On my webapp (tomcat servlet), I want to be able to get the domain name of the client, making this call

Example :
If http://abc.com/crossDomainCall.html is making the cross domain call to my server, I want to be able to see that it is abc.com

What I have tried :
I have tried request.getRemoteAddr() and request.getRemoveHost()
But they are returning the server address which was servicing the HTML at that point of time. Not the server address which is hosting the html (abc.com)

Any pointers on this, will be really appreciated.

Cheers,
Rohitesh

Edit 1 :
As @gigadot replied, using ‘referer’ from HTTP Header, is working for me. But this is not fool proof. So, my question is, how do services like Google Maps do this? I know, that they need to compare an API key, with the corresponding domain which has registered that key. So, how do they verify something like this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:17:17+00:00Added an answer on June 10, 2026 at 8:17 pm

    Try to get referrer header in the request. That is your best bet since the actual call is made by the client side (user or web browser) so it is impossible to always get this. However, referrer header is not always sent by client web browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

CSV has field that is being parsed which may or may not have entries
I have a datagridview that may or may not have rows selected when the
I have an unweighted directed graph that may or may not have cycles in
I have a byte array that may or may not have null bytes at
My situation: ClassA may or may not have a parent of type ClassB .
I have a bunch of models that may or may not have a property
I have a list/collection of objects that may or may not have the same
It is quite possible that I may not have got the point, but I
Since vector elements are stored contiguously, I guess it may not have the same
Imagine you have a large dataset that may or may not be filtered by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.