I'd like to get an URL address of the page that redirects me to another page, in other words suppose that I have three jsp file with the names of one.jsp, two.jsp and three.jsp. the codes of each of them can be seen in the below section:
one.jsp
<a href="two.jsp">go to page two</a>
two.jsp
<%
response.sendRedirect("three.jsp");
%>
three.jsp
<%
out.print(request.getHeader("referer"));
%>
the out put of these will be http://localhost:8080/one.jsp
, but instead I expected to get http://localhost:8080/two.jsp
as the result.
Now I've got two question:
- why I get 'one.jsp' as a result?
- How can i get the URL address of pages that do redirecting? ( in this case
two.jsp
)