title: Struts2 - Can an action name be repeated in the struts.xml using the same action class but for different methods?
body: <p>My idea is to perform actions using Struts2 the below way using a single Action class and multiple methods in it:</p>
  
  <p>View roles action: <code>manage/roles.action?method%3Aview=View</code>
  Add role action: <code>manage/roles.action?method%3Aadd=Add</code></p>
  
  <p>The URLs are called through invoking submit buttons as shown below from test.jsp:</p>
  
  <pre><code>&lt;s:form namespace="/manage/" action="roles" method="get" &gt;
      &lt;s:submit method="view" value="View" /&gt;
      &lt;s:submit method="add" value="Add" /&gt;
      &lt;s:submit method="edit" value="Edit" /&gt;
      &lt;s:submit method="delete" value="Delete" /&gt;
  &lt;/s:form&gt;
  </code></pre>
  
  <p>In struts.xml, I configured:</p>
  
  <pre><code> &lt;package name="portal" namespace="/manage/" extends="struts-default"&gt;
      &lt;action name="home"&gt;
          &lt;result&gt;/WEB-INF/jsp/manage/roles/test.jsp&lt;/result&gt;
      &lt;/action&gt;
  
      &lt;action name="roles" class="struts2.actions.RoleAction" method="view"&gt;
          &lt;result name="success"&gt;/WEB-INF/jsp/manage/roles/viewRoles.jsp&lt;/result&gt;
      &lt;/action&gt;
  
      &lt;action name="roles" class="struts2.actions.RoleAction" method="add"&gt;
          &lt;result name="input"&gt;/WEB-INF/jsp/manage/roles/addRole.jsp&lt;/result&gt;
          &lt;result name="success"&gt;/WEB-INF/jsp/manage/roles/viewRoles.jsp&lt;/result&gt;
      &lt;/action&gt;
  </code></pre>
  
  <p>Unfortunately, when I'm pressing View button, it's showing the result JSP of "add" method. Why?</p>