LoginSignup
0
0

More than 5 years have passed since last update.

JSF2.2 で DOCTYPE が書いたとおりにならない

Last updated at Posted at 2016-05-23

背景

JSF2.2 でFaceletsに記述した通りにDOCTYPEがならない。
DOCTYPEが必ずHTML5のものになってしまう

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

って書いても

<!DOCTYPE html>

になってしまう。

原因

仕様でした。
http://download.oracle.com/otndocs/jcp/jsf-2_2-fr-eval-spec/index.html
詳しくは1.1.1.1参照

対策

パススルー(記述したとおり)にするには、指定しないといけなさそうです。

e.g.
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
    version="2.2">
    <faces-config-extension>
        <facelets-processing>
            <file-extension>.xhtml</file-extension>
            <process-as>xhtml</process-as>
        </facelets-processing>
    </faces-config-extension>
</faces-config>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0