xhtml - JSF/Facelets: why is it not a good idea to mix JSF/Facelets with HTML tags? -


i've read several times now: developers aren't advocates of interleaving jsf/facelets tags html tags in xhtml files. html tags won't part of ui component tree, what's disadvantage of that?

i find code examples authors kind of mixing:

http://www.ibm.com/developerworks/java/library/j-facelets/

http://www.packtpub.com/article/facelets-components-in-jsf-1.2

http://oreilly.com/catalog/9780596529246

"seam in action" interleaves jsf/facelets , html tags.

i'm confused use. started out mixing tags, i'm beginning believe not right choice. however, fail see why puristic approach preferrable.

i know have table jsf datatable doesn't give me enough flexibility display need to, doing puristically isn't possible.

furthermore i'm wondering why none of examples above use f:view etc. instead of hardcoded html, head, body etc. tags.

can please clear me?

during jsf 1.0/1.1 ages indeed "not idea", because html not automatically taken in jsf component tree when using jsp view technology. plain html eagerly jsp rendered before jsf component tree. e.g.

<p>lorem ipsum <h:outputtext value="#{bean.value1}"> dolor sit amet<p> <p>consectetur adipiscing <h:inputtext value="#{bean.value2}" /> elit</p> 

got rendered as

<p>lorem ipsum dolor sit amet<p> <p>consectetur adipiscing elit</p>  value1 <input type="text" value="value2" /> 

to fix need bring <f:verbatim> in.

<f:verbatim><p>lorem ipsum </f:verbatim><h:outputtext value="#{bean.value1}"><f:verbatim> dolor sit amet<p></f:verbatim> <f:verbatim><p>consectetur adipiscing </f:verbatim><h:inputtext value="#{bean.value2}" /><f:verbatim> elit</p></f:verbatim> 

this real maintenance pain. 1 of major reasons why jsf 1.0/1.1 hated.

since jsf 1.2, new view handler, <f:verbatim> not necessary anymore. developers can breathe relieved. moreover, new view handler allowed jsf use different view technology jsp , way facelets born.

see also:


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -