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

前端 未结 2 736
春和景丽
春和景丽 2020-12-01 16:34

I\'ve read this several times now: some developers aren\'t advocates of interleaving JSF/Facelets tags with HTML tags in their XHTML files. Obviously the HTML tags won\'t be

2条回答
  •  情深已故
    2020-12-01 17:30

    During the JSF 1.0/1.1 ages this was indeed "not a good idea", because all the HTML was not automatically taken in the JSF component tree when using JSP as view technology. All plain HTML was eagerly by JSP rendered before the JSF component tree. E.g.

    Lorem ipsum dolor sit amet

    Consectetur adipiscing elit

    got rendered as

    Lorem ipsum dolor sit amet

    Consectetur adipiscing elit

    value1

    To fix this you would need to bring in.

    Lorem ipsum dolor sit amet

    Consectetur adipiscing elit

    This was a real maintenance pain. This was one of the major reasons why JSF 1.0/1.1 was so hated.

    Since JSF 1.2, with the new view handler, the was not necessary anymore. Developers can now breathe relieved. Moreover, the new view handler allowed JSF to use a different view technology than JSP and this way Facelets was born.

    See also:

    • What are the main disadvantages of Java Server Faces 2.0?
    • Why Facelets is preferred over JSP as the view definition language from JSF2.0 onwards?
    • Is it possible to use JSF+Facelets with HTML 4/5?
    • JavaServer Faces 2.2 and HTML5 support, why is XHTML still being used

提交回复
热议问题