Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I have two web.xml files in a single web application?

Can i Have a single application with more than one web.xml files? And can two applications have a parent child relationship so that there are two web.xml?

like image 401
Shans Muga Avatar asked Dec 04 '13 06:12

Shans Muga


1 Answers

For below servlet 3.0 you cannot.

If you are using 3.0 there is a possibility.

In JSR 315: Java Servlet 3.0 Specification, web-fragment.xml is introduced for pluggability of library jars which are packaged under WEB-INF/lib. The content of web.xml and web-fragment.xml are almost the same. One can define servlets, filters and listeners there. One can also specify metadata-complete=true in a given web-fragment.xml. In the latter case, the annotation processing of classes in that jar would be skipped. With web-fragment.xml, library jars can be self-contained and provide web related metadata information.

For sure, having two xml creates confusion and besides all, If you explain whats your exact requirement, you'l get a good/standard solution for your problem.

like image 70
Suresh Atta Avatar answered Sep 27 '22 22:09

Suresh Atta