Home:ALL Converter>Jetty 6 - VirtualHosting

Jetty 6 - VirtualHosting

Ask Time:2010-03-18T08:01:25         Author:Walter White

Json Formatter

I am using Jetty 6 to host multiple web applications for various domains. I am doing the exploded WAR route, so how would I configure that in Jetty? Would I still set the war path and then say extractWar = false?

http://jetty.codehaus.org/jetty/jetty-6/apidocs/org/mortbay/jetty/webapp/WebAppContext.html

<Configure class="org.mortbay.jetty.webapp.WebAppContext">
        <Set name="war"><SystemProperty name="jetty.home"/>/webapps/walterjwhite.com</Set>
        <Set name="extractWAR">false</Set>
        <Set name="contextPath">/</Set>
        <Set name="virtualHosts">
            <Array type="java.lang.String">
                <Item>www.walterjwhite.com</Item>
                <Item>walterjwhite.com</Item>
            </Array>
        </Set>
    </Configure>

I didn't see an example in the documentation, so I'm hoping to get steered in the right direction before testing it out.

Walter

Author:Walter White,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/2466774/jetty-6-virtualhosting
yy