Message-ID: <1949309207.5015.1369497338231.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_5014_2107478854.1369497338230" ------=_Part_5014_2107478854.1369497338230 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The webdefault.xml file su=
pplies configuration of web.xml file elements that would otherwise be repet=
itive and onerous to set up for every web application, such as setting up m=
ime-type mappings, JSP servlet-mappings etc. It is applied BEFORE=
strong> the webapp's own
WEB-INF/web.xml file. Generally, it i=
s convenient for all webapps deployed in a jetty instance to share the same=
webdefault.xml file, however, it is certainly possible to provide differen=
tiated webdefault.xml files for individual web applications.
A common need is to be able to deploy the same unchanged webapp= /war into different environments, but also to have that webapp customized f= or that environment. To some extent, changing configuration in the jetty.xml will help with this, as that fi= le does not form part of the webapp, and so therefore can be changed per de= ployment.
However, there are some things you might want to change that jetty.xml cannot help you with: for example, = servlet init-params and context init-params. Using webdefault.xml won't hel= p you either, because it is applied first so cannot override value= s inside the webapps web.xml.
The solution is to use an override web.xml file. This i=
s another whole or partial web.xml file that resides externall=
y to the webapp, and is applied AFTER the webapp's
There is an example of applying an override web.xml file in
.home/contexts/test.xml. To apply an override to a single webapp:
In code this is:
<overrideWebXml> element as follows:
There is more information on configuring the jetty maven= plugin here.------=_Part_5014_2107478854.1369497338230--