Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Depends on the concrete functional requirement which isn't entirely clear from your question. You could pass an unique request parameter. E.g. when it concerns a GET link:</p> <pre class="lang-html prettyprint-override"><code>&lt;h:link value="Next" outcome="next"&gt; &lt;f:param name="foo" value="bar" /&gt; &lt;/h:link&gt; </code></pre> <p>or a POST link:</p> <pre class="lang-html prettyprint-override"><code>&lt;h:form&gt; &lt;h:commandLink value="Next" action="next"&gt; &lt;f:param name="foo" value="bar" /&gt; &lt;/h:commandLink&gt; &lt;/h:form&gt; </code></pre> <p>with in <code>next.xhtml</code></p> <pre class="lang-html prettyprint-override"><code>&lt;h:someComponent rendered="#{param.foo == 'bar'}"&gt; ... &lt;/h:someComponent&gt; </code></pre> <p>or if you don't care about the param's value:</p> <pre class="lang-html prettyprint-override"><code>&lt;h:someComponent rendered="#{not empty param.foo}"&gt; ... &lt;/h:someComponent&gt; </code></pre> <hr> <p>An alternative which can be much better if you don't want to allow the enduser being able to manipulate the request is to set a bean property during a POST action and then return to the next view:</p> <pre class="lang-html prettyprint-override"><code>&lt;h:form&gt; &lt;h:commandLink value="Next" action="#{bean.next}" /&gt; &lt;/h:form&gt; </code></pre> <p>with e.g.</p> <pre><code>public String next() { foo = "bar"; return "next"; } </code></pre> <p>and in <code>next.xhtml</code></p> <pre class="lang-html prettyprint-override"><code>&lt;h:someComponent rendered="#{bean.foo == 'bar'}"&gt; ... &lt;/h:someComponent&gt; </code></pre>
 

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