title: How to start special init event in a backing bean before JSF page loads?
body: <p>PF 3.5.10, Mojarra 2.1.21, Omnifaces 1.5</p>
  
  <p>How to call special init()-method of some (CDI)SessionScoped bean before I load a .xhtml JSF page ? Now I call init() if user select the page from site menu (with <code>p:menutitem</code>). But what to do if the user use browser address line to type url directly?</p>
  
  <p>Edit: <code>my.xhtml</code>:</p>
  
  <pre><code>&lt;ui:define template="/mytemp.xhtml"&gt;
     &lt;f:event type="preRenderView" listener="#{mybean.init()}" /&gt;
     &lt;h:form&gt;
       &lt;p:commandButton update="@form" ... /&gt;
     &lt;/h:form&gt;
  &lt;/ui:define&gt;
  </code></pre>
  
  <p>If I do it that way the init() will be called on every update (i.e. on every postback to a server),in example on every click of commandButton. So I can not use your proposal.</p>
  
  <p>Edit 2: Thank you Luiggi Mendoza, and BalusC! 
  In addtion to solution from Luiggi Mendoza, as in comments stated the Omnifaces 1.6 will be  have ViewScope also. </p>