在JSF1.2中导航到同一页面
我在JSF1.2页面上有一个名为cancel的h:commandButton按钮,当用户按下这个按钮时,他应该被重定向到同一页面。如何在JSF1.2中实现它?首先记住设置在JSF1.2中导航到同一页面,jsf,jsf-1.2,Jsf,Jsf 1.2,我在JSF1.2页面上有一个名为cancel的h:commandButton按钮,当用户按下这个按钮时,他应该被重定向到同一页面。如何在JSF1.2中实现它?首先记住设置immediate=“true”属性,默认情况下,在调用应用程序之前,标记将调用所有验证程序等 您的按钮: <h:commandButton value="cancel" action="cancel" title="Cancel this page" /> 您的faces-context.xml: <
immediate=“true”
属性,默认情况下,在调用应用程序之前,标记将调用所有验证程序等
您的按钮:
<h:commandButton value="cancel" action="cancel" title="Cancel this page" />
您的faces-context.xml:
<navigation-rule>
<from-view-id>index.xhtml</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>index.xhtml</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
index.xhtml
取消
index.xhtml
首先记住设置immediate=“true”
属性,默认情况下,在调用应用程序之前,标记将调用所有验证器等
您的按钮:
<h:commandButton value="cancel" action="cancel" title="Cancel this page" />
您的faces-context.xml:
<navigation-rule>
<from-view-id>index.xhtml</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>index.xhtml</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
index.xhtml
取消
index.xhtml
no commandButton不在h:form标记中,因此无法工作。在将commandButton放入h:from之后,它现在可以工作了,非常感谢v。没有commandButton不在h:form标签中,所以它不能工作。在把commandButton放进h后:从现在开始,非常感谢v。