gpt4 book ai didi

jsf - 表单组件需要在其祖先中有一个 UIForm。建议 : enclose the necessary components within

转载 作者:行者123 更新时间:2023-12-04 02:00:26 25 4
gpt4 key购买 nike

我的 Facelet 页面上出现以下错误,该页面仅包含一个带有两个字段和两个按钮的 IceFaces 表单:

The form component needs to have a UIForm in its ancestry. Suggestion: enclose the necessary components within <h:form>



这是表格:
<ice:form id="form1" partialSubmit="false">
<ice:panelLayout id="panelLayout3">
<ice:graphicImage id="graphicImage1" url="/resources/images/LoginImage.jpg" width="560" />
<ice:outputLabel for="j_username" id="outputLabel1" value="Username:"/>
<ice:outputLabel for="j_password" id="outputLabel2" value="Password:"/>
<ice:inputText binding="#{login.username}" id="j_username" required="true" />
<ice:inputSecret binding="#{login.password}" id="j_password" required="true" />
<ice:commandButton actionListener="#{login.login}" id="loginBtn" value="Login"/>
<ice:commandButton action="#{login.reset}" id="resetBtn" value="Reset"/>
<ice:outputText id="errorMessage" />
<ice:message errorClass="errorMessage" for="j_username" fatalClass="fatalMessage" id="messages1" infoClass="infoMessage" showSummary="false" warnClass="warnMessage"/>
</ice:panelLayout>
</ice:form>

这是怎么引起的,我该如何解决?

最佳答案

这不是错误。这是一个警告。代码看起来不错,所有输入组件都在一个表单中,看起来它应该可以正常运行。如果它确实工作正常,只需忽略警告。此警告仅在上下文参数 javax.faces.PROJECT_STAGE 时显示设置为 Development反正 。

至于错误警告消息本身,此检查是根据 issue 1663 在 Mojarra 2.1.1 中引入的。 .但是,根据 issue 2147结果证明存在一些错误,并且在 Mojarra 2.1.3 中得到了进一步改进。我认为错误警告是在您的特定情况下由 <ice:panelLayout> 引起的。在表单和输入元素之间。

如果您还没有使用 Mojarra 2.1.3,您可能需要考虑升级以查看它是否删除了错误警告消息。

关于jsf - 表单组件需要在其祖先中有一个 UIForm。建议 : enclose the necessary components within <h:form>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7741046/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com