title: Get current action in jsp - struts2
body: <p>the thing is I'd like to get the current url in a jsp page, but not showing the .jsp page but the action name. For example:</p>
  
  <p>I have the action <a href="http://www.mypage.com/Index" rel="nofollow">http://www.mypage.com/Index</a>, which displays the page <a href="http://www.mypage.com/pages/index.jsp" rel="nofollow">http://www.mypage.com/pages/index.jsp</a>. Is there any way I could obtain the first Url in a jsp file? What I have always returns the path to the jsp, but what I want is the action name. What I have is:</p>
  
  <pre><code>&lt;%=  (request.getServletPath()) %&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>${pageContext.request.requestURL}?${pageContext.request.queryString} //to get the id attached
  </code></pre>
  
  <p>I want this for a simple facebook share button:</p>
  
  <pre><code>&lt;div class="fb-like" data-href="${pageContext.request.requestURL}?${pageContext.request.queryString}" data-send="true" data-width="450" data-show-faces="true"&gt;&lt;/div&gt;
  </code></pre>