Calling a JSF2.x Managed Bean method on page load

Use an <f:event> tag to invoke a method for example on preRenderView lifecycle stage:

<f:event type="preRenderView" listener="#{controllerBeanName.methodName}"></f:event>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.