Is there any way to effect a Conversation.endAndRedirect in pages.xml? For example:
<page view-id="page1.xhtml" conversation-required="true">
<navigation from-action="#{contactManager.newContact}">
<rule if-outcome="success">
<begin-conversation nested="true"/>
<render view-id="newContact.xhtml"/>
</rule>
</navigation>
</page>
<page view-id="page2.xhtml" conversation-required="true">
<navigation from-action="#{contactManager.newContact}">
<rule if-outcome="success">
<begin-conversation nested="true"/>
<render view-id="newContact.xhtml"/>
</rule>
</navigation>
</page>
<page view-id="newContact.xhtml" conversation-required="true">
<navigation from-action="#{contactManager.saveNewContact}">
<rule if-outcome="success">
<!-- endAndRedirect to go back to either page1.xhtml or page2.xhtml depending on who called me -->
</rule>
</navigation>
</page>
Note that the following do not work:
<end-conversation/>
<redirect/>
Nor:
<end-conversation before-redirect="true"/>
<redirect/>
One way I can think of (sort of hackish) would be to use the if attribute of <rule> to invoke a backing bean method that does nothing but call Conversation.instance().endAndRedirect() and return true, but that breaks the if-outcome paradigm that I'm using. Any other suggestions?
Thanks,
Jesse