JSF 2 / PrimeFaces Generates Invalid Markup

UI Components for JSF
Post Reply
User avatar
bumble.bee
Posts: 723
Joined: 29 Sep 2010, 21:39
Location: United States

15 Dec 2010, 16:56

I'm not sure if this is due to Mojarra (2.0.2) or maybe it is PrimeFaces (2.2), but the markup I am seeing is not valid. I believe JSF 2 is supposed to be able to generate valid XHTML 1.0 Transitional markup.

Is this true, or should I be using a different doctype?

I'm using the w3c validator service:

http://validator.w3.org/check

Here are the items that I frequently run into (and will fail):
  • If I include more than one h:form element on a page then validation will fail due to each form having a hidden field with the same id: javax.faces.ViewState
  • The hidden field in each form will have an attribute named autocomplete="off". This attribute is not a valid attribute (although is widely supported and is used to instruct browsers to not use browser's built-in autocomplete feature; this will be included in HTML5 spec I believe).
What I want to avoid is having client browser's thrown into quirks mode.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 54 guests