这是我在 jsf 2.0 项目中尝试的代码。
<h:input value="#{studentInfoBean.registrationFormNo}" id="registrationFormId"/>
<h:commandButton type="submit"
actionListener="# {studentInfoBean.searchStudentbyformNo}">
<f:ajax execute="registrationFormId" render="testlist" />
</h:commandButton>
当我在输入字段中输入一个值然后单击命令按钮时,它会从 bean 中给出一个结果,我的 bean 名称是 studentInfobean SessionScoped。我的问题是,当输入字段为空白时,然后单击命令按钮,因此不调用 bean,因此我没有得到任何响应,我以前的结果保持原样。
谢谢