Context pointing to an external directory in Jetty 9

I want to deploy a .war file for Jetty by setting up a context pointing to my external .war (external webapps folder). I know how to do this in Tomcat, but I can't figure out how to do this for Jetty 9.

In Tomcat, I put an XML file to configure my context in $ CATALINA_HOME / conf / Catalina / localhost:

<?xml version='1.0' encoding='utf-8'?> <!-- Context fragment for deploying ServletExample.war --> <Context path="/CurrencyServlet" docBase="/Users/macbook/Desktop/School/Java/Temp/CurrencyServlet.war" debug="0" privileged="true"/> 

Can someone provide a simple example for Jetty 9?

+4
source share
1 answer

Take a look at the provided file $ jetty_home / webapps / test.xml. In jetty9, you can configure your webapps, etc. by placing the ContextProvider configuration file in $ jetty_home / webapps.

Check out the docs: http://www.eclipse.org/jetty/documentation/current/configuring-contexts.html

This is how you configure the path to your webapp:

 <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/test</Set> 
+3
source

All Articles