marți, 2 ianuarie 2018

Java: Jetty - Deploy war app - using context file

## Install Apache Maven and jetty

## Create war

## Create context file: Context path. Refers to the location which is relative to the server’s address and represents the name of the web application.
## This context file must have the same name as the WAR file

# Create jetty-app.xml in C:\java\jetty-distribution-9.4.8.v20171121\webapps\ folder

<?xml version="1.0"  encoding="ISO-8859-1"?>

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<!-- access the web app from the URL http://localhost:8080/testapp -->
    <Set name="contextPath">/testapp</Set>
<!-- set the path to the war file -->
    <Set name="war">C:\test\jettyapp\jetty-app\target\jetty-app.war</Set>
</Configure>


## Start jetty server
C:\java\jetty-distribution-9.4.8.v20171121>java -jar start.jar


Niciun comentariu:

Trimiteți un comentariu