${jetty 설치경로}/context 디렉토리에 추가할 Context 정보를 기술한 xml 파일을 추가한다. 운영 중인 jetty는 동적으로 추가된 XML 파일을 파싱하여 추가된 Context에 대한 서비스를 시작한다.
예를 들어 /home/tester/sampleWebApp 를 추가하는 경우 아래와 같이 sample.xml 파일을 작성하여, ${jetty 설치경로}/context 디렉토리에 저장한다.
<?xml version=“1.0” encoding=“ISO-8859-1”?><!DOCTYPE Configure PUBLIC “-//Jetty//Configure//EN” “http://www.eclipse.org/jetty/configure.dtd”><Configure class=“org.eclipse.jetty.webapp.WebAppContext”><!– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –><!– Required minimal context configuration : –><!– + contextPath –><!– + war OR resourceBase –><!– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –><Set name=“contextPath”>/sample</Set><Set name=“war”>/home/tester/sampleWebApp</Set></Configure>cs
브라우저 창을 열고 주소창에 http://localhost:8080/sample 을 입력하면, 해당 Context가 호출됨을 확인할 수 있다.