use of com.sun.faces.config.FaceletsConfiguration in project mojarra by eclipse-ee4j.
the class SAXCompiler method writeXmlDecl.
protected static void writeXmlDecl(InputStream is, String encoding, CompilationManager mngr) throws IOException {
is.mark(128);
try {
byte[] b = new byte[128];
if (is.read(b) > 0) {
String r = new String(b, encoding);
Matcher m = XmlDeclaration.matcher(r);
if (m.find()) {
WebConfiguration config = mngr.getWebConfiguration();
FaceletsConfiguration faceletsConfig = config.getFaceletsConfiguration();
boolean currentModeIsXhtml = faceletsConfig.isProcessCurrentDocumentAsFaceletsXhtml(mngr.getAlias());
// with the value of XHTML
if (currentModeIsXhtml) {
Util.saveXMLDECLToFacesContextAttributes(m.group(0) + "\n");
}
}
}
} finally {
is.reset();
}
}
Aggregations