What JSF DTD to use with HTML5 tags

Asked

Viewed 137 times

4

Usually, when I do a JSF page with XHTML, I use the DTD for XHTML 1.0 Transitional.

However, if I use namespace and put some HTML5 tags (passtrough Elements/Attributes), which DTD should I use?

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:jsf="http://xmlns.jcp.org/jsf"
    xmlns:pt="http://xmlns.jcp.org/jsf/passthrough">
    <h:body>
        <input jsf:id="algumaID"/>
        <h:inputText pt:placeholder="algum texto"/>
    </h:body>
</html>

XHTML (page.xhtml)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

or HTML5 (page.html)?

<!DOCTYPE html>

2 answers

1

XHTML was based on html 4. Therefore its syntax does not support things like required, special inputs like date, number or other Html5 facilities. Coming from the front-end, we look forward to the new jsf with support for such.

0

You can put either of the two, I personally use the version of HTML5

<!DOCTYPE html>

Even though it doesn’t matter, as JSF 2.2 will always place it, regardless of what is in your file xhtml. How can you consult in that article

Browser other questions tagged

You are not signed in. Login or sign up in order to post.