1

我必须修改许多 WAR 起始页的内容以添加一些功能。我不能使用过滤器来修改原因过滤器需要放置在 Web 存档中。servlet 等也是如此。任何线索如何做到这一点?

4

1 回答 1

1

您可以修改容器的全局 web.xml。这将影响所有应用程序:

This document defines default values for *all* web applications
loaded into this instance of Tomcat.  As each application is
deployed, this file is processed, followed by the
"/WEB-INF/web.xml" deployment descriptor from your own applications.

或者,您可以实现一个Valve,您将在 server.xml 中为特定主机(将运行所有战争)安装它。

于 2010-03-02T06:42:28.550 回答