What is webdefault.xml?
The webdefault.xml is a file which is applied to a web application BEFORE the application's own WEB-INF/web.xml. It is used to save a web application from having to define a lot of house-keeping and container-specific elements in their own web.xml files.
There is a copy of the webdefault.xml file supplied with jetty in $(jetty.home)/etc/webdefault.xml.
Configuration contained in webdefault.xml
Default Servlet for static content
How to customize webdefault.xml
You can modify any of the settings inside the version of webdefault.xml shipped in the jetty distribution and apply it to web applications by using:
Which equivalently in code is:
Similarly, for the maven jetty plugin, you provide a customized webdefault.xml by: