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 6386943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:05:26+00:00 2026-05-25T03:05:26+00:00

My application is deployed as JavaScript working on some page and web application on

  • 0

My application is deployed as JavaScript working on some page and web application on tomcat somewhere else.

What I try to do now is find a way to determine if request was sent from given web page or was it sent from somewhere else (eg. from localhost – in this case I can not trush sent data).

When I tried to do that in my servlet – in doPost() – I was getting that servlet, as request sender url = http://localhost:8084/app/servlet as a result of:

    String domain = new URL(request.getRequestURL().toString()).toString(); 
    System.out.println("url = " + domain);

What do I need to do, to get URL of page from which my script sent me data?

  • 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-05-25T03:05:27+00:00Added an answer on May 25, 2026 at 3:05 am

    This information is available in the HTTP referer header (yes, with the misspelling):

    String referrer = request.getHeader("referer");
    // ...
    

    Please note that this is fully client-controlled -as everything else in a HTTP request. The client is able to change/spoof it. You should for sure not use it for sensitive business actions. Use it at highest for statistics or informal banners like “Hey, welcome visitor from Google! Your search keywords are highlighted here:” or like.

    If I am not wrong, I think you’re trying to reinvent Google Analytics. You may find this useful as well then: what's the proper way to write a js that will be included in other websites?

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

Sidebar

Related Questions

I have developed a java 1.4 web application.Application is deployed on jboss(tomcat). suppose my
I have a web application deployed on tomcat. In this application are ExecutorService to
We have a web application deployed on a tomcat server. There are certain scheduled
I have a web application deployed in a Tomcat 5.5 container. I use a
I've got an open source static JavaScript + HTML application that's deployed in about
I have an application deployed into multiple zones and there are some issues with
I have a web application deployed in an internet hosting provider. This web application
I have a web application deployed on a jboss server running on a unix
I actually have an application deployed on a Tomcat server but in the future
We have a web application deployed to a server, which was done via an

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.