Java Webアプリケーションでは、「web.xml」ではないファイルにサーブレットをマップできますか? つまり。100 を超えるサーベルをマップする必要があり、web.xml を扱うのは困難です。いくつかのファイルのマッピングをカテゴリごとに分割するのは素晴らしいことです。
何か方法があれば教えてください。
どうもありがとうございました。
web.xml ファイルの分割についてよくわかりません。ただし、web.xml でサーブレットを定義する代わりに、Java 注釈を使用してサーブレットを定義することで、タスクを達成できます。Servlet 3.0 仕様は、サーブレットの宣言に使用できる新しい注釈@WebServletを提供します。
Yes. Servlet 3.0 provides Pluggability Feature which allows you to define web artifacts using:
Web Fragments
. The libraries inside WEB-INF/lib
can have META-INF/web-fragment.xml
which can define part of full deployment descriptor.Annotations
. You can define Servlet, Filters and Listeners using @WebServlet, @WebFilter and @WebListener annotation.