title: How to configure web.xml for multiple login in a Struts2 web application?
body: <p>I would like to develop a small test multi-login application using Struts2 and JSP. Basically:</p>
  
  <ol>
  <li><p>The application should have welcome page (i.e. <code>index.jsp</code>) anyone can access.</p></li>
  <li><p>This welcome page would have two login boxes: one for users and one for administrators.</p></li>
  <li><p>The web application should have two sub-applications, one for users, one for administrator. In other words, it is not a single application where logged-in users would have different privileges. Each sub-application would have their own secluded set of pages.</p></li>
  </ol>
  
  <p>Struts2 uses the MVC pattern and I am wondering how I should use the filter pattern to organize this. I could have all requests under <code>/userapp/*</code> go to the user application and all requests under <code>/adminapp/*</code> go to the admin application. </p>
  
  <p>My questions are:</p>
  
  <ol>
  <li><p>Is this the right strategy (i.e. best practice)? If yes, how should I implement this in my <code>web.xml</code>?</p></li>
  <li><p>Should I implement two filters and two mappings (if yes why?) or should I implement one filter and two mappings?</p></li>
  </ol>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After doing a lot of reading, I get to understand that Struts2 multi-login is an over-engineered and too heavy solution for what I need. I have decided to implement my own Servlet 3.0 and use JQuery + Ajax.</p>