Create a context file with the same name as the WAR file of your web application inside the $JETTY_HOME/contexts directory.
test.xml
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <configure class="org.eclipse.jetty.webapp.WebAppContext"> <set name="contextPath">/test</set> <set name="war"><systemproperty name="jetty.home" default="."/>/webapps/test.war</set> </configure>
Put your WAR file in $JETTY_HOME/webapps/test.war
Launch Jetty from the command line by calling
java -jar start.jar
when in the Jetty home directory.
source share