Sun 是否已弃用 Java DTD URL?

发布于 2024-10-03 07:29:39 字数 521 浏览 6 评论 0原文

我们在 ANT 脚本中使用 xmltask ANT 任务来执行条件逻辑(即:if 语句)。

目前此任务正在轰炸,显然是因为无法到达“http://java.sun.com/ dtd/application_1_3.dtd”。我们也无法在浏览器中访问此 URL。 Sun 是否已“弃用”这些 Java DTD URL?


更新:似乎 http://java.sun.com/ 也不可用。不确定这是否是 Sun/Oracle 端的中断或者该站点是否已停用。

更新2:好的,现在可以了。从昨天起就没有工作过——我发誓!我认为@Jeremy 是对的,我们需要自己主持这个活动。

We use the xmltask ANT task for conditional logic (ie: if statements) in our ANT scripts.

Currently this task is bombing, apparently because can't reach "http://java.sun.com/dtd/application_1_3.dtd". We can't access this URL either in our browser. Has Sun "deprecated" these Java DTD URL's?


Update: Appears http://java.sun.com/ is not available either. Not sure if this is a outage on Sun/Oracle's end or if this site has been decommissioned.

Update 2: Ok, now it is working. Hasn't been working since yesterday - I swear! I think @Jeremy is right we need to host this ourselves.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

帅气尐潴 2024-10-10 07:29:39

我建议您下载并自行托管。

http://java.sun.com/dtd/

I suggest you just download it and host it yourself.

http://java.sun.com/dtd/

夜雨飘雪 2024-10-10 07:29:39

它并没有被弃用。根据此帖子,这是一个临时问题。

无论如何,依赖外部托管的 DTD 无论如何都是一个坏主意,应该避免。

由于 URI 用作标识符,因此有时更改它们并不简单。然而,每个 XML 解析器都应该有一个选项来自定义 DTD(或模式)的加载方式,并且应该可以使用本地副本而不是远程副本。此外,这将减少对外部连接的需求并加快 XML 的加载速度。

It's not being deprecated. It's a temporary issue, according to this thread.

Anyway, depending on externally hosted DTDs is a bad idea anyway and should be avoided.

Since the URIs are used as identifier, changing them isn't trivial, sometimes. However every XML parser should have an option to customize how DTDs (or Schemas) are loaded and it should be possible to use a local copy instead of the remote one. Additionally this would reduce the need for external connectivity and would speed up loading the XML.

盗心人 2024-10-10 07:29:39

能够在没有网络访问的情况下构建东西是件好事。下面是一个自托管 DTD 和 xmltask 的示例,供后代参考。

构建文件顶部附近的某个位置(${ext.dir} 是本地文件路径):

<xmlcatalog id="commonDTDs">
    <dtd publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" location="${ext.dir}/dtd/web-app_2_3.dtd" />
    <dtd publicId="-//tuckey.org//DTD UrlRewrite 3.2//EN" location="${ext.dir}/dtd/urlrewrite3.2.dtd" />
</xmlcatalog>

稍后使用 xmlcatalog refId:

<xmltask source="${war.dir}/WEB-INF/web.xml" dest="${war.dir}/WEB-INF/web.xml">
    <xmlcatalog refId="commonDTDs" />
    <remove path="web-app/servlet[servlet-class/text()='loader.servlet.FileServlet']" />
    <remove path="web-app/servlet-mapping[servlet-name/text()='FileServlet']" />
</xmltask>

Being able to build stuff without having network access is kind of nice. Here's an example of self-hosted DTDs and xmltask, for posterity.

Somewhere near the top of the build file (${ext.dir} being a local file path):

<xmlcatalog id="commonDTDs">
    <dtd publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" location="${ext.dir}/dtd/web-app_2_3.dtd" />
    <dtd publicId="-//tuckey.org//DTD UrlRewrite 3.2//EN" location="${ext.dir}/dtd/urlrewrite3.2.dtd" />
</xmlcatalog>

reference it later using xmlcatalog refId:

<xmltask source="${war.dir}/WEB-INF/web.xml" dest="${war.dir}/WEB-INF/web.xml">
    <xmlcatalog refId="commonDTDs" />
    <remove path="web-app/servlet[servlet-class/text()='loader.servlet.FileServlet']" />
    <remove path="web-app/servlet-mapping[servlet-name/text()='FileServlet']" />
</xmltask>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文