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
Post a Comment