I have the following thing:
<ui:param name="randomVideo" value="#{bean.randomVideo}" />
<a href="#{randomVideo.link}">#{randomVideo.text}</a&></pre>
Because <ui:param> does not cache the variable, Bean.getRandomVideo() is called twice, and the worst part is that the .text and .link are from different videos. I have already tried <c:set and <f:param. They both do not set the variable, maybe because I'm with facelets (JSF2).
Any ideas?
Getters are supposed to be real getters, not containing any logic. So:
bean @RequestScoped
randomVideo field in @PostConstruct
randomVideo field of the bean.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With