gpt4 book ai didi

maven - 在 jetty 中删除 web.xml 中的过滤器

转载 作者:行者123 更新时间:2023-12-02 02:10:52 24 4
gpt4 key购买 nike

我已将 jetty 配置为使用 jetty 专家运行我的网络应用程序。 Jetty 应该是开发的轻型替代方案,因此它不需要 web.xml 中的所有内容。更具体地说,我想删除 web.xml 中的过滤器。

我尝试使用 overrideDescriptor 配置属性,但这只允许我覆盖 web.xml,而不是替换它。因此,过滤器仍然存在。

关于如何在不修改原始 web.xml 文件的情况下删除过滤器的任何想法?

最佳答案

由于没有答案,我会发布我的解决方案,这并不完美。

<!-- Jetty configuration -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.5.v20120716</version>
<configuration>
<webApp>
<descriptor>src/main/webapp/mock-web.xml</descriptor>
[...]
</webApp>
[...]
</configuration>
</plugin>

这种方法的缺点是您必须维护两个几乎相同的 web.xml 文件。我还没有找到允许我覆盖原始 web.xml 文件并删除监听器的解决方案。

关于maven - 在 jetty 中删除 web.xml 中的过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12955059/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com