title: How to submit values by post using an action, method in Struts 2
body: <p>I have a question, but I couldn't find a solution for my problem.</p>
  
  <pre><code>&lt;s:form name="form1" method="post" action="products" theme="simple"&gt;
    &lt;s:hidden name="code" value="%{code}"/&gt;
    &lt;s:submit type="button" name="method:selectSale" value="goPage"/&gt;
  &lt;/s:form&gt;
  </code></pre>
  
  <p>This code has no problem.</p>
  
  <p>But, I want to use "anchor" instead of "submit" tag. I just want to use hyperlink and 'post' way, not 'get'. How can I do this? </p>
  
  <pre><code>&lt;s:form name="form1" method="post" action="products" theme="simple"&gt;
    &lt;s:hidden name="code" value="%{code}"/&gt;
    &lt;a href="#" onclick="javascript:document.form1.submit()"&gt;goPage&lt;/a&gt;
  &lt;/s:form&gt;
  </code></pre>
  
  <p>It doesn't work. </p>
  
  <p>The main problem is how to get "method:selectSale".</p>
  
  <p>in struts.xml,</p>
  
  <pre><code>&lt;action name="products" class="sample.ProductsAction"&gt;
    &lt;result&gt;abc.jsp&lt;/result&gt;
  &lt;/action&gt;
  </code></pre>
  
  <p>and then, in ProductsAction.java,</p>
  
  <pre><code>public String selectSale() throws Exception {
    // ~~~
    return "selectSale"
  }
  </code></pre>
  
  <p>Ok, now, I have a question.</p>
  
  <p>where do i have to put <code>"selectSale"</code> on code? ( using <code>&lt;s:a&gt;</code> or <code>&lt;a:&gt;</code> )</p>