Get jsp current page
<p>I have a footer with a few links that open in the same tab, but I want to have them open in a new tab whenever the user is on the payment page.
I have decided to do it with using <code>boolean</code> condition that becomes true whenever the user is on <code>/payment.jsp</code>. What I am not sure about is how to get the current page?</p>

<pre><code>&lt;% boolean paymentPage = false; %&gt;

&lt;% if(paymentPage ){ %&gt;
        &lt;new tab&gt;
&lt;% } else{ %&gt;
        &lt;same tab&gt;
&lt;% } %&gt;
</code></pre>

<p>It seems to me that the best way to do so is to use the <code>HttpServletRequest</code> interface. I was hoping I could get an advice on how to implement it in my code. I assume it would look something like this?</p>

<pre><code>&lt;% private boolean paymentPageTest (HttpServletRequest request) { %&gt;
&lt;%  return request.getRequestURL.equals("/Payment.jsp"); %&gt;
&lt;% } %&gt;
</code></pre>