jsf 2 - XML prolog / instruction not removed from XHTML output -
i'm starting learn javaserver faces (jsf). i'm using glassfish 3+. i've created new jsf project in netbeans , run project. worked fine, upon examining xhtml output, noticed xml declaration left in. messes doctype declaration (which supposed first in document).
is jsf supposed remove xml declaration, or there i've done wrong?
facelets default remove compositions (include files , composite components) , tag files. won't remove master template. remove yourself. shouldn't using xml prolog @ when authoring html.
whether xml prolog removed master template specified in appendix 1.1.1.1 of jsf 2.2 specification describes configuration of <facelets-processing>
element in faces-config.xml
. xml prolog described "processing instructions". in table, you'll see removed (consumed) when template processed xml or jspx view.
1.1.1.1
facelets-processing
elementthe
<facelets-processing>
element used affect processing of facelets vdl files. therefore, setting applies requests reach faceletsviewdeclarationlanguage
implementation, specified runtime viajavax.faces.facelets_view_mappings
,javax.faces.default_suffix
<context-param>
entries. specification defines 3 processing modes facelets files: facelets xhtml syntax, xml view syntax, , facelets jspx syntax. last syntax intended ease migration facelets applications using jsp document syntax (also known jspx syntax). affect on processing of files in each of these 3 modes specified in following table.valid <process-as> values , implications on processing of facelets. ----------------------------------------------------------------------------------------- <process-as> <process-as> <process-as> <process-as> html5</process-as> xhtml</process-as> xml</process-as> jspx</process-as> html 5 (default) facelets xhtml xml view facelets jspx ----------------------------------------------------------------------------------------- xml doctype simplified passed through consumed consumed <!doctype html> xml passed through passed through consumed consumed declaration processing passed through passed through consumed consumed instructions cdata passed through passed through consumed consumed section escaping of escaped escaped escaped not escaped inline text xml passed through passed through consumed consumed comments
in preceding table, “passed through” means content passed through unmodified user agent. “consumed” means content silently consumed on server. note cdata sections, content of cdata section passed through, if start , end tags should consumed. “escaped” means sensivite content in response automatically escaped:
&
becomes&
, example. “not escaped” means such content not escaped.
in other words, when you're authoring html5/xhtml, have remove yourself. better wording actually: you shouldn't including xml prolog in html5 , xhtml pages that's not required; it's required in xml , jspx pages (and facelets automatically remove it).
see also:
- javaserver faces 2.2 , html5 support, why xhtml still being used
- is possible use jsf+facelets html 4/5?
unrelated concrete problem, should using <h:outputstylesheet>
instead of <link rel="stylesheet">
independent request url.
<h:outputstylesheet name="css/default.css" /> <h:outputstylesheet name="css/csslayout.css" />
Comments
Post a Comment