質問がありますが、韓国の Web コミュニティで問題の解決策が見つかりませんでした。
<s:form name="form1" method="post" action="products" theme="simple">
<s:hidden name="code" value="%{code}"/>
<s:submit type="button" name="method:selectSale" value="goPage"/>
</s:form>
このコードは問題ありません。
でも、「submit」タグの代わりに「anchor」タグを使いたい。「取得」ではなく、ハイパーリンクと「投稿」の方法を使用したいだけです。これどうやってするの?助けてください〜:)
<s:form name="form1" method="post" action="products" theme="simple">
<s:hidden name="code" value="%{code}"/>
<a href="#" onclick="javascript:document.form1.submit()">goPage</a>
</s:form>
うまくいきません。:(
主な問題は、「method:selectSale」を取得する方法です。
struts.xmlで、
<action name="products" class="sample.ProductsAction">
<result>abc.jsp</result>
<result name="selectSale">selectSale.jsp</result>
</action>
次に、ProductsAction.javaで、
public String selectSale() throws Exception {
// ~~~
return "selectSale"
}
さて、質問があります。
コードのどこに「selectSale」を配置する必要がありますか? (<s:a>
またはを使用<a:>
)