title: How to use multiple buttons (one on each line) for JSP page using Struts2
body: <p>I don't really know how to title my question, but I have a JSP page with a table displaying elements from a database, and I want to have a button for each row to either delete or edit that particular row. Here is the part of my JSP page where I generate the table (the table and buttons are generated fine)</p>
  
  <pre><code>&lt;style type="text/css"&gt;
    table { empty-cells: show; }
  &lt;/style&gt;
  &lt;table border="1"&gt;
  &lt;tr&gt;
  &lt;th&gt;Action&lt;/th&gt;
    &lt;s:iterator value="columnNames" id="name"&gt;
      &lt;th&gt; &lt;s:property value="name" /&gt; &lt;/th&gt;
    &lt;/s:iterator&gt;
  &lt;/tr&gt;
   &lt;s:iterator value="%{table}" id="row"&gt;
   &lt;tr&gt;
     &lt;td&gt;
     &lt;table&gt;&lt;tr&gt;&lt;td&gt;
     &lt;s:form action="edit" namespace="/." theme="simple"&gt;
     &lt;s:submit value="Edit" name="edit" /&gt;
     &lt;/s:form&gt;&lt;/td&gt;
     &lt;td&gt;
     &lt;s:form action="remove" namespace="/." theme="simple"&gt;
     &lt;s:submit value="Remove" name="remove" /&gt;
     &lt;/s:form&gt;&lt;/td&gt;&lt;/tr&gt;
     &lt;/table&gt;&lt;/td&gt;
       &lt;s:iterator value="%{#row}" id="cell"&gt;
            &lt;td&gt;&lt;s:property value="%{#cell}"/&gt;&lt;/td&gt;
       &lt;/s:iterator&gt;
   &lt;/tr&gt;
   &lt;/s:iterator&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>How would I get it so that when I click on a particular button on a certain row, that my program will know which row it should perform the action on (edit/delete)? Sorry, I'm still pretty new to Struts2 still...</p>