title: Dynamic delete on jsp file
body: <p>i want to remove some table lines dynamicaly using struts2 and ajax.</p>
  
  <p>i got an object "object1" which contains a list of "object2"</p>
  
  <pre><code>public class Object1 {
  [...]
  private int id;
  [...]
  private List&lt;Object2&gt; objs2;
  [...]
  }
  </code></pre>
  
  <p>in a jsp file a display informations about object1 in a form to be able to modify some input. 
  To display the list i use an iterator.</p>
  
  <pre><code>&lt;s:iterator value="object1.objs2" status="objsStatus"&gt;
  </code></pre>
  
  <p>this work fine, and i want to be able to delete one of these object2. so i put a link after each object2 which call a "delete" action with struts2-jquery.</p>
  
  <pre><code>&lt;s:url id="delObject" value="/deleteObject2.action"/&gt;
  &lt;sj:a id="delObj%{#objsStatus.index}" href="%{delObj}?object2.name=%{name}" targets="result"&gt;delete&lt;/sj:a&gt;
  </code></pre>
  
  <p>my struts.xml</p>
  
  <pre><code>&lt;action name="deleteObject2" class="Object2Action" method="deleteObj"&gt;
     &lt;result&gt;&lt;/result&gt;
  &lt;/action&gt;
  </code></pre>
  
  <p>this also works fine BUT (there always a but...) i have to "refresh" manually the page to see the "new" list of object2. is it possible to call a javascript function on result success to remove the appropriate table line, using for example:</p>
  
  <pre><code> $(this).closest('tr:not(:only-child)').remove();
  </code></pre>