Results 1 to 1 of 1
  1. #1
    albertozurita is offline Member
    Join Date
    Aug 2014
    Rep Power

    Default getHeader('referer') question


    I have a servlet survey application I have been working on. My problem is that request.getHeader('referer') is not getting the right referal url the first time it access the application.
    However the second time(or any other time) it does get the correct one.

    The first time the application requires a user to take a survey, and then redirects them to the resource url. The second time it only redirects the user to the resource, since they have already taken the survey. I have 2 java files handling the take.survey logic, and the second one just redirecting and logging information (survey.logic)

    Both routine files use request.getHeader('referer'). The first time the user is required to take the survey(take.survey).

    As I said before, the app will record on the database the target url, instead of the referral url. The second time it runs smoothly, and gets the correct referral information.


    I am calling the app from a page with the following address:

    refering page:

    The app resides at:


    The following link is inserted into to access the app:



    1st time of clicking link it records: app/take.survey?url=
    2nd time of clicking link it gets the right value:
    3rd time correct value,and so.

    Again, both files use: request.getHeader('referer') to get the referral value.

    Any ideas?


    Last edited by albertozurita; 08-07-2014 at 07:49 PM.

Similar Threads

  1. Replies: 2
    Last Post: 05-25-2012, 05:00 PM
  2. question posted by indissa: library question.
    By Fubarable in forum New To Java
    Replies: 2
    Last Post: 11-18-2011, 02:14 AM
  3. Using JSTL to capture HTTP referer data and serialize into a variable
    By jeremy.wilson in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 05-19-2011, 01:44 PM
  4. Referer Problem : very Important
    By berkdulger in forum Java Servlet
    Replies: 1
    Last Post: 07-17-2007, 05:59 PM
  5. Important : Referer Problem
    By berkdulger in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 07-17-2007, 02:25 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts