【问题标题】:Multiple web fragments with the same res-ref-name具有相同 res-ref-name 的多个 Web 片段
【发布时间】:2016-04-18 13:49:35
【问题描述】:
  1. 如果我有多个网络片段声明 resource-refs 和相同的 res-ref-name 会发生什么情况:

    • resource-refs 具有相同的res-type
    • resource-refs 有不同的res-type
  2. 如果resource-refweb.xml 中有相同的res-ref-name 会发生什么情况:

    • resource-refs 具有相同的res-type
    • resource-refs 有不同的res-type

我正在寻找规格说明的内容,而不是“尝试找出答案”。

【问题讨论】:

    标签: servlets jakarta-ee jndi web.xml web-fragment


    【解决方案1】:

    Java Servlet Specification Version 3.1 在 §8.2.1 中有以下内容:

    当前对单个 web.xml 存在的名称唯一性要求也适用于 web.xml 和所有适用的 web-fragment.xml 文件的联合。

    §14.4 说:

    res-ref-name 指定资源管理器连接工厂引用的名称。该名称是相对于 java:comp/env 上下文的 JNDI 名称。该名称在部署文件中必须是唯一的。

    因此,您的应用程序应该无法部署。

    【讨论】:

      猜你喜欢
      • 2015-10-05
      • 1970-01-01
      • 1970-01-01
      • 2019-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-30
      相关资源
      最近更新 更多