tags:

views:

34

answers:

1

I have an application i can war up which i usually use with tomcat in an exploded-ear configuration.

How can i get it to work most painlessly with jetty? I am finding the documentation a bit ambiguous in this area.

A: 

Create a context file with the same name as your web application WAR file 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://jetty.mortbay.org/configure.dtd"&gt;
<configure class="org.mortbay.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

Start Jetty from the command line by calling

java -jar start.jar

when in the home Jetty directory.

paddydub