jetty的404页面在哪里?

where does 404 page of jetty locate at?

我使用 jetty 和 jersey 构建了 restful 服务。当 jersey return 404 响应时,jetty 会 return 一个 404 网页:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 </title>
</head>
<body>
<h2>HTTP ERROR: 404</h2>
<p>Problem accessing /test/404page. Reason:
<pre>    Not Found</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>

但是,除了 404 状态代码,我什么都不想要。我想删除默认的 404 页面,但找不到它所在的位置。我该怎么办?

您需要做的是将以下球衣 属性 设置为 true

ServerProperties.RESPONSE_SET_STATUS_OVER_SEND_ERROR

这将使它只发送状态代码,而不发送错误页面。