title: How to create custom URL in Struts 2? Like www.twitter.com/goodyzain
body: <p>I am working on a project where I want to provide unique URL for each user.</p>
  <p>For example:</p>
  <ul>
  <li><code>www.SocialNetwork.com/jhon</code></li>
  <li><code>www.SocialNetwork.com/jasmine</code></li>
  </ul>
  <p>So far I'm able to achieve this:</p>
  <ul>
  <li><code>www.SocialNetwork.com/profiles/jasmine</code></li>
  </ul>
  <p>here <code>profiles</code> is my action where I can get the user name by</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;constant name=&quot;struts.mapper.alwaysSelectFullNamespace&quot; value=&quot;false&quot;/&gt;
  &lt;constant name=&quot;struts.enable.SlashesInActionNames&quot; value=&quot;true&quot;/&gt;
  &lt;constant name=&quot;struts.patternMatcher&quot; value=&quot;namedVariable&quot;/&gt; 
  
  
  &lt;action name=&quot;profiles/{username}&quot; class=&quot;com.example.actions.ViewProfileAction&quot;&gt;
    &lt;result name=&quot;input&quot;&gt;/WEB-INF/jsp/profile.jsp&lt;/result&gt;
  &lt;/action&gt; 
  </code></pre>
  <p>but I want to achieve something <em>like</em> this:</p>
  <ul>
  <li><code>www.SocialNetwork.com/jasmine</code></li>
  </ul>
  <p>Just use <em>domain name</em> and <em>username</em>.</p>
  <p>Like Twitter does:</p>
  <ul>
  <li><code>www.twitter.com/username</code></li>
  </ul>
  <p>How to achieve this?</p>