Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/354.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Java的Play2.2.x中的XHTML5_Java_Html_Xhtml_Playframework 2.0 - Fatal编程技术网

使用Java的Play2.2.x中的XHTML5

使用Java的Play2.2.x中的XHTML5,java,html,xhtml,playframework-2.0,Java,Html,Xhtml,Playframework 2.0,如何将内容类型全局设置为application/xhtml+xml,而不仅仅是在结果级别?在Play框架Java项目中 我的xhtml5页面如下所示: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de"> <head>

如何将内容类型全局设置为application/xhtml+xml,而不仅仅是在结果级别?在Play框架Java项目中

我的xhtml5页面如下所示:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
      <head>
        <meta charset="utf-8"/>
      </head>
      <body></body>
    </html>
结果由返回okindex.render生成


如果未通过response.setContentTypeapplication/xhtml+xml设置内容类型,则play framework将提供不正确的文本/html。

您的意思是要将所有页面自动设置为application/xhtml+xml,而不必手动为每个文件设置该内容类型?是的,我要将其设置为所有服务页面的默认值。