JSF中的回发

JSF中的回发,jsf,postback,oracle-adf,Jsf,Postback,Oracle Adf,我创建了一个非常简单的JSF来测试什么是回发。JSP包含一个outputtext以打印“adfFacesContext.postback”表达式,以及一个按钮以进行提交 <f:view> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> <title>TEST</title> </h

我创建了一个非常简单的JSF来测试什么是回发。JSP包含一个outputtext以打印“adfFacesContext.postback”表达式,以及一个按钮以进行提交

<f:view>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
  <title>TEST</title>
</head>
<body>
  <af:form>        
    <h:outputText value="#{adfFacesContext.postback}" />
    <h:commandButton value="SUBMIT" action="ok"/>
  </af:form>
  </body>
</html>
</f:view>
我在faces-config.xml中创建了一个导航规则:

  <navigation-rule>
    <from-view-id>/test.jsp</from-view-id>    
    <navigation-case>
      <from-outcome>ok</from-outcome>
      <to-view-id>/test.jsp</to-view-id>
    </navigation-case>    
  </navigation-rule>
第一次加载页面时,adfFacesContext.postback表达式的计算结果为false,因此一切正常

但当我按下按钮时,adfFacesContext.postback表达式的计算结果再次为false

为什么?

我注意到,如果我从faces-config.xml中删除导航规则,当我按下按钮时,adfFacesContext.postback表达式的计算结果为true


为什么我必须删除导航规则才能得到正确的结果?

您使用的是ADF-JSF还是标准JSF?ADF-JSF的生命周期与标准JSF不同。我使用的是在JSF1上构建的ADF10G。生命周期是不同的,但因为ADF扩展了阶段的数量。标准JSF阶段是相同的。