{"id":731,"date":"2010-01-08T10:42:16","date_gmt":"2010-01-08T10:42:16","guid":{"rendered":"http:\/\/salientsoft.co.uk\/?p=731"},"modified":"2011-11-17T13:40:54","modified_gmt":"2011-11-17T13:40:54","slug":"icefaces-facelets-page-missing-doctype-puts-ie-in-quirks-mode","status":"publish","type":"post","link":"https:\/\/salientsoft.co.uk\/?p=731","title":{"rendered":"ICEfaces facelets strips DOCTYPE, puts IE in quirks mode"},"content":{"rendered":"<p>By default when you create a new ICEfaces Facelets project with a sample page, it codes the DOCTYPE directive directly. Unfortunately, this is stripped out during processing\/rendering and does not\u00a0 appear in the final HTML for the page. When running IE without a suitable DOCTYPE directive, it switches into <a title=\"http:\/\/en.wikipedia.org\/wiki\/Quirks_mode\" href=\"http:\/\/en.wikipedia.org\/wiki\/Quirks_mode\"><strong>Quirks Mode<\/strong><\/a> and is not fully standards compliant, which may cause pages to display incorrectly.<\/p>\n<p>the DOCTYPE can be added back by using the <strong>&lt;ice:outputDeclaration&gt;<\/strong> tag. To do this, you also need to add an <strong>&lt;f:view&gt;<\/strong> tag as you would in JSP mode, as in the following example :-<\/p>\n<pre>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;f:view xmlns=\"<a href=\"http:\/\/www.w3.org\/1999\/xhtml\">http:\/\/www.w3.org\/1999\/xhtml<\/a>\"\r\n\u00a0xmlns:ui=\"<a href=\"http:\/\/java.sun.com\/jsf\/facelets\">http:\/\/java.sun.com\/jsf\/facelets<\/a>\"\r\n\u00a0xmlns:f=\"<a href=\"http:\/\/java.sun.com\/jsf\/core\">http:\/\/java.sun.com\/jsf\/core<\/a>\"\r\n\u00a0xmlns:h=\"<a href=\"http:\/\/java.sun.com\/jsf\/html\">http:\/\/java.sun.com\/jsf\/html<\/a>\"\r\n\u00a0xmlns:ice=\"<a href=\"http:\/\/www.icesoft.com\/icefaces\/component\">http:\/\/www.icesoft.com\/icefaces\/component<\/a>\"&gt;\r\n\u00a0&lt;ice:outputDeclaration\r\n  doctypeRoot=\"HTML\" doctypePublic=\"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\"\r\n\u00a0\u00a0doctypeSystem=\"<a href=\"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\">http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd<\/a>\" \/&gt;\r\n\u00a0&lt;html&gt;\r\n\u00a0\u00a0\u00a0 &lt;head&gt;\r\n    ...\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n    ...\r\n    &lt;\/body&gt;\r\n &lt;\/html&gt;\r\n&lt;\/f:view&gt;<\/pre>\n<p>The issue is discussed and solved\u00a0in <a title=\"http:\/\/www.icefaces.org\/JForum\/posts\/list\/15782.page\" href=\"http:\/\/www.icefaces.org\/JForum\/posts\/list\/15782.page\"><strong>this<\/strong><\/a> ICEfaces forum post. Interestingly, a page created by ICEfaces\u00a0for a \u00a0JSP (non-facelet) project also uses the <strong>&lt;ice:outputDeclaration&gt; <\/strong>tag, presumably for the same reason.<\/p>\n<p>Note that you cannot omit the <strong>&lt;f:view&gt;<\/strong> tag and add the <strong>xmlns<\/strong> namespace declarations to the <strong>&lt;ice:outputDeclaration&gt;<\/strong> tag as this fails &#8211; the <strong>&lt;f:view&gt;<\/strong> tag needs to be present.<\/p>\n<p>Another post about Quirks mode and DOCTYPE switching, which also contains a useful Bookmarklet (Javascript link) which will tell you directly what mode a page is running in, may be found <strong><a title=\"http:\/\/salientsoft.co.uk\/?p=759\" href=\"http:\/\/salientsoft.co.uk\/?p=759\">here<\/a>.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default when you create a new ICEfaces Facelets project with a sample page, it codes the DOCTYPE directive directly. Unfortunately, this is stripped out during processing\/rendering and does not\u00a0 appear in the final HTML for the page. When running IE without a suitable DOCTYPE directive, it switches into Quirks Mode and is not fully [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[22],"tags":[13,76,23,87,184,88],"_links":{"self":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/731"}],"collection":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=731"}],"version-history":[{"count":12,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/731\/revisions"}],"predecessor-version":[{"id":734,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/731\/revisions\/734"}],"wp:attachment":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}