Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jakarta ee web.xml web资源名称不是可选的_Jakarta Ee_Web.xml - Fatal编程技术网

Jakarta ee web.xml web资源名称不是可选的

Jakarta ee web.xml web资源名称不是可选的,jakarta-ee,web.xml,Jakarta Ee,Web.xml,最近,我在JEE应用程序中添加了授权,为了实现这一点,我在我们的web.xml中添加了以下几行内容: web.xml 对各自XML模式的交叉引用强调了这一假设: web-common_3_1.xsd web资源collectionType用于标识 资源和HTTP方法,这些资源上的 安全约束适用。如果未指定HTTP方法, 然后,安全约束将应用于所有HTTP方法。 如果HTTP方法由HTTP方法省略指定 元素时,安全约束将应用于所有方法 除了集合中确定的那些。 http方法省略和http方法元素永

最近,我在JEE应用程序中添加了授权,为了实现这一点,我在我们的
web.xml
中添加了以下几行内容:

web.xml 对各自XML模式的交叉引用强调了这一假设:

web-common_3_1.xsd

web资源collectionType用于标识
资源和HTTP方法,这些资源上的
安全约束适用。如果未指定HTTP方法,
然后,安全约束将应用于所有HTTP方法。
如果HTTP方法由HTTP方法省略指定
元素时,安全约束将应用于所有方法
除了集合中确定的那些。
http方法省略和http方法元素永远不会被忽略
混合在同一个集合中。
用于:安全约束
网站资源名称包含此网站的名称
资源收集。
那么,除了将其设置为不在场证明名称之外,它还有什么用途?为什么Oracle将其描述为

web资源名称是用于此资源的名称。它的使用是可选的


当XML模式明确指出它是强制性的时?

我不知道它的目的是什么,也不知道为什么它是强制性的,但是WebSphere和WildFly都接受它不存在,没有任何错误或警告。
<security-constraint>
    <web-resource-collection>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>USER_LOGIN</role-name>
    </auth-constraint>
</security-constraint>
<security-constraint>
    <web-resource-collection>
        <web-resource-name></web-resource-name>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>USER_LOGIN</role-name>
    </auth-constraint>
</security-constraint>
<xsd:complexType name="web-resource-collectionType">
    <xsd:annotation>
        <xsd:documentation>

            The web-resource-collectionType is used to identify the
            resources and HTTP methods on those resources to which a
            security constraint applies. If no HTTP methods are specified,
            then the security constraint applies to all HTTP methods.
            If HTTP methods are specified by http-method-omission
            elements, the security constraint applies to all methods
            except those identified in the collection.
            http-method-omission and http-method elements are never
            mixed in the same collection. 

            Used in: security-constraint

        </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
        <xsd:element name="web-resource-name" type="javaee:string">
            <xsd:annotation>
                <xsd:documentation>

                    The web-resource-name contains the name of this web
                    resource collection.

                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>