• Post Reply Bookmark Topic Watch Topic
  • New Topic

Facelets  RSS feed

 
vinutha
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we use HTML instead of XHTML in facelets?
The XHTML are static or dynami?
I think we can not use HTML in facelets, but i am not confirmed.
Explain to me in steps with some practicle example if possible.


Thanks,
Vinutha.
 
Alex Browning
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope, facelets requires xml complaint code. HTML is not true xml.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bigger question is "why use html at all?". I use xhtml even on my regular html pages. Because it's more stringent, I can use smarter tools.

Also, if html ever goes obsolete, it will be because xhtml or one of its relatives replaces it. Even if the replacement isn't the xhtml of today, I'll stand a better chance of being able to do automated conversions to the new platform.
 
vinutha
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alex,

Thanks for tour expalination.
Can you tell why this facelets require xml complaint code, and wheather this XHTML is static or dynamic?
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like I said in your other post. xhtml is easier to parse. The Facelets system doesn't just copy the xhtml, it picks it apart, merges it with other pages components and produces a new output that will ultimately be HTML (or xhtml).

Since your page definition has to be in xhtml, the xml parser is assured that your page definition tags will be well-formed. Every opening tag will match a closing tag. This means that the Facelets system doesn't have to guess where to put things or whether or not you miscoded a page or tile definition at the structural level.

If the page component isn't well-formed xml conforming to the xhtml schema or DTD, the xml parser will reject it as being in error. Facelets won't even have to look at the code, since it already knows it's bad. Conversely, if it's good xhtml, facelets doesn't have to waste time checking to see if it's properly structured, since the xml parser already did so.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!