首页 > 解决方案 > 在 web.xml 中将 cookie 设置为 false

问题描述

现在我在 META-INF 下有 context.xml,

<Context  cookies="false"/>

和WEB-INF下的web.xml,

<web-app>
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>restricted methods</web-resource-name>
            <url-pattern>/*</url-pattern>
            <http-method-omission>HEAD</http-method-omission>
        </web-resource-collection>
        <auth-constraint/>
    </security-constraint>
</web-app>

是否可以在单个 XML 文件中维护这两个?

标签: web.xmltomcat9context.xml

解决方案


推荐阅读