I have tried a million different ways the last week to get jetty presenting a simple static html file. But it keeps giving me a 404 result.
The setup is:
- Jetty is installed in: /usr/lib/jetty-home-11.0.2
- The Jetty base dir: ~/Documents/projects/jetty/statWebApp/jetty_base
- The module installed is http. (start.jar --add-module=http)
In ${jetty.base}/webapps are two files index.html and web.xml
the web.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.server.handler.ContextHandler">
<Set name="contextPath">/</Set>
<Set name="handler">
<New class="org.eclipse.jetty.server.handler.ResourceHandler">
<Set name="resourceBase">/*</Set>
<Set name="directoriesListed">true</Set>
</New>
</Set>
</Configure>
The server is started with: ${jetty.base}/webapps java -jar /usr/lib/jetty-home-11.0.2/start.jar
I expect to see the index.html file when browsed to http://localhost:8080/.
I got 404 page presented by jetty. Therefor I know the server is started but it is not showing the page.
Any help on getting Jetty working will be very welcome.