【发布时间】:2012-05-19 05:37:55
【问题描述】:
我在我的 Web 应用程序中使用 Struts 框架,当我单击单选按钮医生时,我的编码遇到问题,嗯,它要求提供 docid,因此配置文件将被更新,但如果用户不提供 id 并选择医生并保存配置文件,由于 bean 中的 getter setter 具有这些值,只是更新功能不起作用..病理学家也一样..
<html:form action="upAction" enctype="multipart/form-data">
<table>
<tr class="show" id="admhide">
<td align="left" valign="middle" nowrap><bean:message key="sp.type"/></td>
<td align="left" nowrap><html:radio property="type" value="Patient" name="reg" styleId="patradio" onclick="show(this.value);"/>Patient
<html:radio property="type" value="Doctor" name="reg" styleId="docradio" onclick="show(this.value);"/>Doctor
<html:radio property="type" value="Pathologist" name="reg" styleId="pathradio" onclick="show(this.value);"/>Pathologist</td>
</tr>
<tr class="hide" id="doctor">
<td align="left" valign="middle" nowrap><bean:message key="sp.docid"/></td>
<td nowrap align="left" ><html:text property="docid" name="reg" styleId="docid"/></td>
</tr>
<tr class="hide" id="patho">
<td align="left" valign="middle" nowrap><bean:message key="sp.pathoid"/></td>
<td nowrap align="left" ><html:text property="pid" name="reg" styleId="pathid"/></td>
</tr>
<tr>
<td colspan="2" align="center" valign="middle" nowrap><html:submit styleClass="button2" property="method"><bean:message key="userform.upd"/></html:submit></td>
</tr>
</table>
</html:form>
请帮助我如何做到这一点,以便如果用户填写错误的 docid 或没有 docid 表单,不要在 getter setter 中设置其余值并且不会提交 .. 谢谢 ..
【问题讨论】:
标签: html jsp jakarta-ee jdbc struts