Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的应用程序中,我想从managebeanby检查 null 验证Customvalidator。我正在使用 jsf1.2 并且我在表单中有 a<h:inputText>和 a submitButton,当我单击 submitButton 将inputText字段留空时,我想从支持 bean 生成一条消息。另外一件事我还validator使用名为#{manageBean.validateField}. 我该如何实现这一点。谢谢 ,
managebean
Customvalidator
<h:inputText>
submitButton
inputText
validator
#{manageBean.validateField}
如果您只想检查必填字段,则可以使用组件的requiredandrequiredMessage属性。
required
requiredMessage
<h:inputText id="fldName" value="#{managedBean.property}" required="true" requiredMessage="Please enter value..."/> <h:message for="fldName"/>