我有以下jsp
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns="http://www.w3.org/1999/xhtml"
version="2.0">
<jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
<jsp:output omit-xml-declaration="true" />
<jsp:output doctype-root-element="html" doctype-system="about:legacy-compat"/>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>HTML5</title>
</head>
<body>
<h1>HTML5</h1>
</body>
</html>
</jsp:root>
而默认的tomcat7生成的html看起来像
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en"><head><meta content="text/html; charset=utf-8" http-equiv="content-type"/><title>HTML5</title></head><body><h1>HTML5</h1></body></html>
我希望它被打印出来(更适合调试)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 11 February 2007), see www.w3.org" />
<meta content="text/html; charset=us-ascii" http-equiv="content-type" />
<title>HTML5</title>
</head>
<body>
<h1>HTML5</h1>
</body>
我想如果我编写与 html 相同的页面并将其命名为 jsp 它将保留它的格式并且我仍然可以使用 jsp 标记。