複数のプロジェクトが通信し、リソースを共有するため、Tomcat コンテナーで一緒にホストされる予定です。各プロジェクトは個別に開発され、独自の web.xml があります
個々のプロジェクト Web アプリケーション展開記述子 (project-web.xml) を 1 つの web.xml にインポートして展開する方法はありますか。
If you are using Tomcat 7.0.x, you could try to create a common JAR file with all the shared classes and add a META-INF/web-fragment.xml
to the archive. This is file is similar to the web.xml
file and you could use it to add common filter, servlet, etc...
<?xml version="1.0" encoding="UTF-8"?>
<web-fragment xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd"
version="3.0">
<!-- content like web.xml -->
</web-fragment>