Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在JSF1.2中导航到同一页面_Jsf_Jsf 1.2 - Fatal编程技术网

在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: <

我在JSF1.2页面上有一个名为cancel的h:commandButton按钮,当用户按下这个按钮时,他应该被重定向到同一页面。如何在JSF1.2中实现它?

首先记住设置
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。