jsf 2 - <ui:param and caching -


i have following thing:

<ui:param name="randomvideo" value="#{bean.randomvideo}" /> <a href="#{randomvideo.link}">#{randomvideo.text}</a&></pre> 

because <ui:param> not cache variable, bean.getrandomvideo() called twice, , worst part .text , .link different videos. have tried <c:set , <f:param. both not set variable, maybe because i'm facelets (jsf2).

any ideas?

getters supposed real getters, not containing logic. so:

  • make bean @requestscoped
  • initialize randomvideo field in @postconstruct
  • let getter retrieve randomvideo field of bean.

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -