2

I am creating a JSF web application and currently formulating a template.xhtml file. Inside my xhtml file I have created a header and a footer using div elements. However, reading up on HTML5 i understand that you can now use <header> and <footer> tags.

When trying to implement these tags in MyEclipse they show up as "Unknown Tags". I have checked the doctype declaration and it states <!DOCTYPE html. I was under the assumption that this is all that it needed to support HTML5.

My Template.xhtml file is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ace="http://www.icefaces.org/icefaces/components"
    xmlns:icecore="http://www.icefaces.org/icefaces/core"
    xmlns:ice="http://www.icesoft.com/icefaces/component"
     xml:lang="en" lang="en">

<h:head>
<title><ui:insert name="title"></ui:insert></title>
<link href="#{request.contextPath}/resources/css/Template.css" rel="stylesheet" type="text/css"/>

</h:head>

<h:body>

<header></header>

<div id="header">
<ui:insert name="header">
<h1>OAG Reference Data</h1>
</ui:insert>
</div>

<div id="container">
<ui:insert>

<div id="sidebar">
<ui:insert name="sideBar">
<h:form>
<ace:menu type="sliding" zindex="2">
    <ace:submenu label="Carrier">
        <ace:menuItem value="General Carrier Data" />
        <ace:menuItem value="Contact Info" />
        <ace:menuItem value="Alliance Membership" />
    </ace:submenu>
</ace:menu>
</h:form>
</ui:insert>
</div>

<div id="content">
<ui:insert name="content">
<h1>Content</h1>

</ui:insert>
</div>


</ui:insert>
</div>


<div id="footer">
<ui:insert name="footer">
<h1>Footer#{bundle['application.defaultpage.footer.content']}</h1>
</ui:insert>
</div>



</h:body>
</html>

I feel that I have misunderstood something along the way. I would appreciate if anyone can clear this up for me.

Thanks

LiamWilson94
  • 458
  • 2
  • 7
  • 26

1 Answers1

3

I have checked the doctype declaration and it states <!DOCTYPE html. I was under the assumption that this is all that it needed to support HTML5.

If you add the missing character >, then the assumption is correct.

<!DOCTYPE html>

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Thank you for your answer. I have done as mentioned above and I can now use the
    html5 tags. However, the JSF Icefaces feature (ace:menu) that I added no longer renders/displays on the page?
    – LiamWilson94 Jan 19 '15 at 10:03
  • Not sure what exactly you mean. What's the generated HTML output? – BalusC Jan 19 '15 at 10:08
  • Prior to the change the icefaces functionality displayed on the xhtml page. However, when changing the doctype the menu no longer displays on the page as before. – LiamWilson94 Jan 19 '15 at 10:10
  • I redeployed my app onto the server and it now displays fine. Not sure why it didn't work after the first re-deploy. Anyway, thank you for your help. – LiamWilson94 Jan 19 '15 at 10:12
  • Slightly off topic, but do you know if there is a web tool or a method of certifying if my app meets html5 standards? Thanks. – LiamWilson94 Jan 19 '15 at 10:19