Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After checking the source code the problem is related to outcome:</p> <p>the com.sun.faces.flow.FlowHandlerImpl.getFlow method need Id to be not null:</p> <pre><code>public Flow getFlow(FacesContext context, String definingDocumentId, String id) { Util.notNull("context", context); Util.notNull("definingDocumentId", definingDocumentId); Util.notNull("id", id); </code></pre> <p>The com.sun.faces.application.NavigationHandlerImpl:</p> <pre><code>result.isFlowEntryFromExplicitRule = null != fh.getFlow(ctx, toFlowDocumentId, outcome); </code></pre> <p>So the outcome is null and exception is rised. In my case I don't have outcome. </p> <p>If is needed <strong>from-outcome</strong> then in some place has to be ejecuted an action. To accomplish that the login.xhtml page need a <strong>f:viewAction</strong>.</p> <p>Implementing all this now my the requested use case is working well. If <strong>from-action</strong> is declared then the <strong>from-outcome</strong> is optional and vice versa.</p> <p>If the same logic of redirection is required when user go to root folder (domain/appname/) the only thing that has to be done is to add welcome-file to web.xml.</p> <pre><code>&lt;welcome-file&gt;login.jsf&lt;/welcome-file&gt; </code></pre> <p>Finally this is the navigation rule declaration</p> <pre><code>&lt;navigation-rule&gt; &lt;from-view-id&gt;/login.xhtml&lt;/from-view-id&gt; &lt;navigation-case&gt; &lt;!--optional&lt;from-action&gt;#{bean.loggedInNavigationRuleAction}&lt;/from-action&gt;--&gt; &lt;from-outcome&gt;logged&lt;/from-outcome&gt; &lt;if&gt;#{identity.loggedIn}&lt;/if&gt; &lt;to-view-id&gt;/home.xhtml&lt;/to-view-id&gt; &lt;redirect /&gt; &lt;/navigation-case&gt; &lt;/navigation-rule&gt; </code></pre> <p>And this has to be added to login.xhtml</p> <pre><code>&lt;f:metadata&gt; &lt;f:viewParam name="x" value="#{bean.x}"/&gt; &lt;f:viewAction action="#{bean.loggedInNavigationRuleAction}" phase="APPLY_REQUEST_VALUES"/&gt; &lt;/f:metadata&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload