I have been working in Oracle iStore from past 4 months and I have been managing the application without any IDE (basically doing all the chores on notepad only because appl
An easy way would be grabbing the (legendaric misspelled) HTTP referer header. You can get it in a Servlet as follows:
String referrer = request.getHeader("referer");
And in a JSP as follows:
${header.referer}
You should however realize that this is a client-controlled value and can be changed/spoofed/hacked to something entirely different or even removed.
If you want a bit more reliable approach, then you'll really need to add an extra parameter to the request. In a plain vanilla link you can set it as a query string.
<a href="b.jsp?from=a.jsp">go to b.jsp</a>
or as a hidden input element in a form:
<form action="b.jsp" method="post">
<input type="hidden" name="from" value="a.jsp">
...
Either way, you can get in a Servlet as follows:
String from = request.getParameter("from");
or in a JSP as follows:
${param.from}
use request.getHeader("Referer");