java.io.IOException:服务器返回HTTP响应代码:503为URL:http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd [英] java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

查看:1087
本文介绍了java.io.IOException:服务器返回HTTP响应代码:503为URL:http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在以下代码中:

private Document transformDoc(Source source) throws TransformerException, IOException {
    TransformerFactory factory = TransformerFactory.newInstance();

    Transformer transformer =
            factory.newTransformer(new StreamSource(xsltResource.getInputStream()));
    JDOMResult result = new JDOMResult();
    transformer.transform(source, result);
    return result.getDocument();
}

我得到这个例外:

java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

我通过xsl翻译的XHTML是:

The XHTML I'm translating over via xsl is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  <title>Terms and Conditions</title>
</head>
<body>
  <div>Test Content</div>
</body>
</html>

如何阻止xalan变压器打电话回家?

How do I stop the xalan transformer from phoning home?

推荐答案

来自Xalan-J邮件列表的这篇文章表明正确的方法供您配置基础来源 / 读者自己禁用验证。

This post from the Xalan-J mailing list suggests that "the right way" is for you to configure the underlying Source/Reader yourself to disable validation.

这篇关于java.io.IOException:服务器返回HTTP响应代码:503为URL:http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆