In general, fine tuning of every web application can be done in jetty-web.xml file placed in WEB-INF directory.
Enabling virtual hosts for a webapp
This example explains how to assign current webapp to a number of virtaul hosts and specific context path.
- Create a jetty-web.xml in WEB-INF directory of your webapp.
- Put in jetty-web.xml your specific configuration like listed below:
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath">/mycontext</Set>
<Set name="virtualHosts">
<Array type="java.lang.String">
<Item>333.444.555.666</Item>
<Item>127.0.0.1</Item>
<Item>www.blah.com</Item>
<Item>www.blah.net</Item>
<Item>www.blah.org</Item>
</Array>
</Set>
</Configure>
- Package your application in .war file and deploy it in Mule WebContainer. Thats it.