Giovanni
Giovanni

Reputation: 543

Does Primefaces render invalid HTML?

To build a very simple web app for my company I'm evaluating some web frameworks, including PrimeFaces. One strict requirement is the accessibility, and the fact that the HTML must be valid (checked against W3C Validator). I've played a bit with the examples and I've noticed that the HTML rendered is not valid. The invalid block is the following:

<input name="javax.faces.ViewState" id="javax.faces.ViewState" value="2042368857675116551:8104174386673838460" autocomplete="off" type="hidden">

and the reason is:

line 74 column 159 - Errore: Attribute autocomplete not allowed on element input at this point.

So, can I perform some action on Primefaces in order to render valid HTML code? I didn't go deep into Primefaces, but I guess I have little control over how controls are rendered. Has anyone experience on this problem (validity of HTML rendered by PF) and would like to share it? Thanks

Upvotes: 0

Views: 214

Answers (1)

Kukeltje
Kukeltje

Reputation: 12337

The viewstate is not something that PrimeFaces adds to your rendered html but the jsf implementation. If you use mojarra there are some parameters that you can set to tune things (not tested this myself, just did some simple googling for you (hint, hint)).

See in How to let JSF render conform XHTML 1.0 strict?

Upvotes: 1

Related Questions