我正在使用JSF 2.0和Facelets做一个项目.
我已经阅读<ui:debug/>了有关按下CTRL-SHIFT-D时标签提供有价值的故障排除信息的文档.但这对我不起作用.请有人告诉我我错过了什么.
(我试过各种热键,仍然没有成功例如:. <ui:debug hotkey="a"/>)
我在我的Facelet页面上收到以下错误,该页面只包含一个带有两个字段和两个按钮的IceFaces表单:
表单组件需要在其祖先中具有UIForm.建议:在<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>
Run Code Online (Sandbox Code Playgroud)
这是怎么造成的,我该如何解决?
我想知道当我有一些JSF语法错误时,它是否可以禁用页面底部出现的错误消息:
<ul title="Project Stage[Development]: Unhandled Messages"
id="javax_faces_developmentstage_messages">
<li style="Color: orange">
The button/link/text component needs to have a Form in its ancestry. Please
add <h:form>.
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
你不能说"添加表格标签".
我需要一个链接,将我重定向到另一个站点并发送POST参数.就像是:
<h:form>
<h:commandButton value="submit" action="http://example.com">
<f:param name="user" value="robson">
</h:commandButton>
</h:form>
Run Code Online (Sandbox Code Playgroud)
上面的代码当然不起作用.
我想用HTML实现这一点:
<form action="http://example.com" method="POST">
<input type="hidden" name="user" value="robson">
<input type="submit" value="submit">
</form>
Run Code Online (Sandbox Code Playgroud)
那可能吗?