According to your own answer on this topic:
I removed the f: verbatim tag and now it works correctly. I still don't understand why this caused this behavior.
<f:verbatim> was introduced in JSF 1.0 a long time ago for the sole purpose of incorporating plain HTML into the JSF component tree. In JSF 1.0 (and 1.1), when the component tree was built, all plain HTML was ignored. First, the page is processed using all simple HTML, and then the HTML code of the JSF components is displayed. For example,
<p>Hello</p> <h:inputText /> <p>World</p> <h:outputText value="outputtext" /> <p>This is weird</p>
it will turn out like
<p>Hello</p> <p>World</p> <p>This is weird</p> <input type="text" /> outputtext
<f:verbatim> allowed developers to use simple HTML in the JSF component tree so that they appear "synchronously" as you would expect from coding.
<f:verbatim><p>Hello</p></f:verbatim> <h:inputText /> <f:verbatim><p>World</p></f:verbatim> <h:outputText value="outputtext" /> <f:verbatim><p>This is weird</p></f:verbatim>
However, they are inserted while viewing the build , and not while viewing the render . This is the cause of your problem, getters are called during the recovery phase, and not for rendering the response phase.
Since JSF 1.2, with an improved view handler, you could embed plain HTML "in sync" without any problems with the ugly <f:verbatim> tags. So this is no longer necessary. There are also no useful use cases for a tag, expect some premature performance optimizations, but you should not use it in conjunction with dynamic data obtained using an expression language.
Related questions:
- (Dis) Benefits of JSF 2.0
Balusc
source share