Ignoring web.xml when loading a WAR file with Jetty
问题 I'm trying a self-executable WAR package with Jetty. It configures with web.xml by default. If a run-time option is given, I wanted to override web.xml by Java code-level configuration with ServletContextHandler#addServlet, #addEventListener, and ... Can I ignore web.xml while loading a WAR package? % java -jar foobar.jar # Use web.xml % java -jar foobar.jar --customize=something # Use Java code to configure // Example WebAppContext webapp = new WebAppContext(); webapp.setWar(warLocation