title: How to access the current page url typed in jsp?
body: <p>I use <strong>.htaccess</strong> file for url rewritting.To enable .htaccess file I  put the <strong>urlrewritefilter-4.0.3.jar</strong> file inside WEB-INF\lib\ and inside web.xml I have added the following code.</p>
  
  <pre><code>   &lt;filter&gt;
        &lt;filter-name&gt;UrlRewriteFilter&lt;/filter-name&gt;
            &lt;filter-class&gt;org.tuckey.web.filters.urlrewrite.UrlRewriteFilter&lt;/filter-class&gt;
  </code></pre>
  
  <p>defaults to false. use mod_rewrite style configuration file (if this is true and confPath is not specified confPath will be set to /WEB-INF/.htaccess)</p>
  
  <pre><code>   &lt;init-param&gt;
         &lt;param-name&gt;modRewriteConf&lt;/param-name&gt;
         &lt;param-value&gt;true&lt;/param-value&gt;
     &lt;/init-param&gt;
     &lt;/filter&gt;
     &lt;filter-mapping&gt;
      &lt;filter-name&gt;UrlRewriteFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
      &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
     &lt;/filter-mapping&gt;`
  </code></pre>
  
  <p>My .htacces file code is</p>
  
  <pre><code>    RewriteRule ^/()$ index.jsp [NC,L]
      RewriteRule ^/login/?$ login.jsp [NC,L] #Handle requests for "login"
      RewriteRule ^/logout/?$ login.jsp [NC,L] #Handle requests for "login"
      RewriteRule ^/contact_us/?$ contact.jsp [NC,L] #Handle requests for "contactus"
      RewriteRule ^([/A-Za-z0-9_]+)$ user.jsp [NC,L]
      RewriteRule ^([/A-Za-z0-9_]+)/$ user.jsp [NC,L]
  </code></pre>
  
  <p>I have one user.jsp file. I used regular expression for url maping so that what ever i type in url it open the user.jsp file.
  I want to access the actual url typed inside the user.jsp file.
  Suppose I type <code>http://localhost:8080/project/abhiramgiri</code>. I used</p>
  
  <pre><code>  &lt;%
         String getURL=request.getRequestURI();
         out.print(getURL);
    %&gt;
  </code></pre>
  
  <p>It shows the path to the file as <code>http://localhost:8080/project/user.jsp</code>
  Actually I need <code>http://localhost:8080/project/abhiramgiri</code>.
  It does not show the actual typed url. It retrieve the original path.
  Please, Help me for this problem.</p>