I have 3 pages with 3 links that I tried implementing with h:link
or simply an <a>
tag. But in both cases the methods connected to these links are getting called whenever I navigate to the page.
Here's the <a>
tag implementation:
<a href="#{bean.gotoMySrchie()}">
<h:graphicImage library="images" name='vo2/FavPlus.png' />
</a>
<a href="#{bean.gotoMySearches()}">
<h:graphicImage library="images" name='vo2/SearchesPlus.png' />
</a>
<a href="#{bean.gotoMyBids()}">
<h:graphicImage library="images" name='vo2/BidsPlus.png' />
</a>
The h:link
implementation looks like this:
<h:link title="Searches" id="searchesLogo" value="" outcome="#{bean.gotoMySearches()}">
<h:graphicImage library="images" name='vo2/SearchesPlus.png' />
</h:link>
The problem is that each of these action methods is calling my database and this is a complete waste of a call. So is there a way in JSF2 to navigate between pages, while using the action methods for actually doing something, but without these methods getting called when I don't need them to get called?