3

Can someone point to me or explain if this is true, you must not use plain any plain HTML tags in JSF or JSF libraries like RichFaces?

We're using JSF 1.2, RichFaces 3.3.3 and Facelets on JBOSS server.

Someone said to me that we must use only <rich:> or <f:> or <a4j:> and the components they offer. Reason being that the JSF component tree would break and you may have unwanted behaviour. Or lose the JSF tree structure at some point and the functionality associated with it.

I was trying to use a plain <h1> tag and was told to not use it and use a <a4j:outputPanel> instead (which renders as a <div>) and style it to look like a heading.

I'm having a hard time believing this.

Moin Zaman
  • 25,281
  • 6
  • 70
  • 74
  • 2
    Related: [JSF vs HTML](http://stackoverflow.com/questions/3273595/jsf-vs-htmljsp-for-enterprise-portals-ui-layer-which-one-to-choose-and-why) and [Disadvantages of JSF](http://stackoverflow.com/questions/3623911/what-are-the-main-disadvantages-of-java-server-faces-2-0). – BalusC Oct 07 '10 at 10:51
  • Thanks BalusC. That was excellent info, and more links to other useful info. – Moin Zaman Oct 07 '10 at 17:02

3 Answers3

5

You are right not to believe this. There is absolutely no problem in using plain HTML tags.

Facelets creates UIComponents even for static markup (i.e. non-JSF). It should just be valid.

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140
3

There were some limitations in mixing jsf and hthml in jsf 1.0 and 1.1 . You had to use the <f:verbatim> tag to render your html correctly. Maybe the person that told told you not to use plain html had this limitation in mind.

Giorgos Dimtsas
  • 12,019
  • 3
  • 29
  • 40
  • Yes, they did show me some documentation about this. However, the current documentation actually says not to use `` for self rendered containers. see: http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/ArchitectureOverview.html#LimitationsAndRules – Moin Zaman Oct 07 '10 at 07:12
0

I'll confirm what has been said, you can easily mix and match HTML and RichFaces tags.

Max Katz
  • 1,582
  • 1
  • 9
  • 5