信息:警告:FacesMessage已入队,但可能未显示 [英] INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed
问题描述
我创建了一个带有用于从用户那里获取信息的表格的用户界面.当我提交表单时,它将在服务器日志中显示以下警告:
I created an user interface with a form to get information from user. When I submit the form, it prints the following warning in the server log:
INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=j_idt7:j_idt11[severity=(ERROR 2), summary=(j_idt7:j_idt11: Validation Error: Value is not valid), detail=(j_idt7:j_idt11: Validation Error: Value is not valid)]
我试图解决它,但是我不知道如何解决.这个问题是怎么引起的,我该如何解决?
I tried to solve it, however I didn't understand how. How is this problem caused and how can I solve it?
推荐答案
对于涉及未显示的Validation Error: Value is not valid
消息的警告,这意味着您在某个<h:selectXxx>
组件(例如<h:selectOneMenu>
)中没有相关的<h:message>
,因此JSF无法直接在UI中显示有关转换/验证错误的人脸消息.
As to the warning referring an undisplayed Validation Error: Value is not valid
message, this means that you've somewhere a <h:selectXxx>
component such as <h:selectOneMenu>
without an associated <h:message>
and therefore JSF is not able to display faces messages about conversion/validation errors directly in the UI.
为了解决特定的警告,只需添加<h:message>
:
In order to fix the particular warning, just add a <h:message>
:
<h:selectOneMenu id="foo" ... />
<h:message for="foo" />
请注意,当您使用<f:ajax>
进行Ajax提交表单时,您不应忘记将消息包含在ajax更新中.首先,使用render="@form"
更新整个表单.
Note that when you're ajax-submitting the form using <f:ajax>
, then you should not forgot to include the messages in the ajax-update. To start with, use render="@form"
to update the entire form.
As to the concrete validation error problem which is mentioned in the message, head to the following answer: Validation Error: Value is not valid.
这篇关于信息:警告:FacesMessage已入队,但可能未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!