我正在处理一些代码:
verify_scan_image_main.jsp
:
......
<s:form id="scanImageReportFrom" action="" method="post">
......
<tr>
<td align="left" width="12%">
<s:submit type="button" label="Find" onclick="return goFind();"
method="verifyScanImage" style="width:60px" theme="simple" />
</td>
</tr>
</s:form>
<script language="JavaScript">
function goFind()
{
......
scanImageReportFrom.action = 'scanimagereport/verifyScanImage.action';
scanImageReportFrom.submit();
return false;
}
</script>
struts.xml
:
<struts>
......
<package name="scanimagereport" extends="struts-default">
......
<action name="verifyScanImage"
class="hk.net.scanimagereport.action.VerifyScanImageAction"
method="verifyScanImage">
<result name="success">/verify_scan_image_main.jsp</result>
<result name="input">/verify_scan_image_main.jsp</result>
</action>
</package>
</struts>
在上面的代码中,如果我goFind()
如下改变函数,结果是不一样的。我不明白为什么。
<script language="JavaScript">
function goFind()
{
......
//scanImageReportFrom.action = 'scanimagereport/verifyScanImage.action';
//scanImageReportFrom.submit();
//return false;
return true;
}
</script>