We generally write a web.xml file for deploying our websites. The file generally contains the mappings for various Servlets present in the WEB-INF folder of the website. I have created a website and its web.xml file and deployed it in Apache Tomcat-9 server. Now, I want to deploy the same website into the Jetty-9 container. What changes do I need to make so that it works in Jetty as well? Do I need to make any changes to the web.xml file? Do I need to change the structure of the .war file ?
Normally no, the content of the web.xml file and the structure of a webapps (essentially WEB-INF/
and META-INF/
folders) are described in the Servlet specification, so all webapps should be able to be deployed as is in any servlet compliant container.
That being said, I have seen some case where the container asked to add some "proprietary" elements in web.xml, so your best bet is to test it.