I have three JSPs named a.jsp , b.jsp and c.jsp.
From a.jsp I am going to b.jsp .
Then the following code in b.jsp request.getHeader("Referer") returns a.jsp
Again from b.jsp I am going to c.jsp .
From c.jsp I am pressing browser back button to come to b.jsp.
Then again the following code in b.jsp request.getHeader("Referer") returns a.jsp
Why is it not returning c.jsp ?
Is there any way so that I can get c.jsp on the browser back button.
the reason could be that your page is cached.
you can check the http header by using firebug.
UPDATE 1
I have created a new project with a.jsp, b.jsp, c.jsp, here is the code:
a.jsp:
b.jsp
c.jsp
It works well. you can create a new project with the code, and test it. i am not sure, what is your situation, maybe you are using AJAX, then the referer will only should URL of the last whole page.