Jsf richfaces和显示错误消息
如何在“必填字段”前显示文本“说明”Jsf richfaces和显示错误消息 ,jsf,richfaces,Jsf,Richfaces,如何在“必填字段”前显示文本“说明” 就像richfaces演示页面上使用的一样,请看一看-它只显示了一条消息。我发现我的messages\u en.properties文件中缺少了一些内容 当我使用seam setup创建一个时,生成的文件包含如下内容: javax.faces.converter.IntegerConverter.INTEGER=值不是数字 javax.faces.component.UIInput.REQUIRED=必填字段 当我加上: javax.faces.conver
就像richfaces演示页面上使用的一样,请看一看-它只显示了一条消息。我发现我的messages\u en.properties文件中缺少了一些内容 当我使用
seam setup
创建一个时,生成的文件包含如下内容:
javax.faces.converter.IntegerConverter.INTEGER=值不是数字
javax.faces.component.UIInput.REQUIRED=必填字段
当我加上:
javax.faces.converter.IntegerConverter.INTEGER={2}:值不是数字
或
javax.faces.component.UIInput.REQUIRED={0}:必填字段
字段标签添加在消息前面
<h:form id="userSettingsForm">
<rich:messages>
<f:facet name="errorMarker">
<h:graphicImage value="/img/msgerror.png" />
</f:facet>
</rich:messages>
<h:outputText value="Description:" />
<h:inputText label="Description:" id="description"
value="#{userSettingsForm.instance.description}" required="true"
size="5">
<f:validateLength minimum="3" />
</h:inputText>
<a:commandButton value="Validate" />
</h:form>