In JSF2, is there a way to stop a method from being called automatically? For example, in my bean:
public String goToSearchResults() {
// do all kinds of stuff
}
In my .xhtml
file:
<p:commandLink id="srchbutton" action="#{home.goToSearchResults()}">
<h:graphicImage.../>
</p:commandLink>
This method is called whenever the user arrives at my home page, before even specifying search terms. Obviously it's an unnecessary call. Is there a way to prevent it?