<script language="JavaScript"> <!-- var isClicked = false; function hopupSubmit(actionURL){ var form = document.forms[0]; form.action = actionURL; form.target= new Date(); form.submit(); return false; } function noHopupSubmit(actionURL){ if(isClicked){ alert("現在処理中です少々お待ちください"); return false; } isClicked = true; var form = document.forms[0]; form.action = actionURL; form.target= ""; form.submit(); return false; } // --> </script> <form> <input type="submit" value="<bean:message key="label.pdf.button" />" onClick="hopupSubmit('<html:rewrite page="/aaa.do"/>')"/> <input type="submit" value="<bean:message key="label.pdf.button" />" onClick="noHopupSubmit('<html:rewrite page="/bbb.do"/>')"/> </form>
bean:define タグを使って一旦(プリコンパイルされたJSPの)内部変数にしてから <%= %> で埋め込めばよい。
下の例は、ファイル名の一覧(MapのCollection)から、ラジオボタンでファイル名を選ぶ画面。通常の使い方だと html:radio の value は変更できない。
<table border="1"> <logic:iterate id="map" name="FileInfoList" > <tr><th></th><th>ファイル名</th><th>登録日</th><th>最終更新日</th></tr> <tr> <td> <bean:define id="radioKey" name="map" property="FILE_NAME"/> <html:radio property="selectedFileName" value="<%=radioKey%>"/> </td> <td><bean:write name="map" property="FILE_NAME"/></td> <td><bean:write name="map" property="REGIST_DATE"/></td> <td><bean:write name="map" property="UPDATE_DATE"/></td> </tr> </logic:iterate> </table>
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %> <html:html> <head></head> <body> <table border="0"> <tr><td> <tiles:insert page="/pages/common.jsp" /> </td></tr><tr><td> ページ固有のコンテンツ </td></tr> </table> </body> </html>