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

    Default getHeader('referer') question

    Hello,

    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.


    example:

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

    refering page: thispage.com

    The app resides at:

    app/take.survey


    The following link is inserted into thispage.com to access the app:

    app/take.survey?url=http://google.com


    RESULTS:

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


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


    Any ideas?

    Thanks.

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

Similar Threads

  1. Replies: 2
    Last Post: 05-25-2012, 04:00 PM
  2. question posted by indissa: library question.
    By Fubarable in forum New To Java
    Replies: 2
    Last Post: 11-18-2011, 01: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, 12:44 PM
  4. Referer Problem : very Important
    By berkdulger in forum Java Servlet
    Replies: 1
    Last Post: 07-17-2007, 04:59 PM
  5. Important : Referer Problem
    By berkdulger in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 07-17-2007, 01: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
  •