For testing purposes, I want to use Jetty 8 to serve only static content. I know how to start a web server from the command line:
java -jar start.jar jetty.port = 8082
I would like to be able to use vanilla Jetty, preferably 8 or 7, and run it using something like:
java -jar start.jar OPTIONS = resources resources.root = .. / foo jetty.port = 8082
Then the files should be accessible from the server root directory. A file named ../foo/x.html
should be accessible via http://localhost:8082/x.html
.
I do not want to create a WAR file or something interesting. Preferably, it should not do server-side caching, leaving files unlocked on Windows computers. In addition, I only want to serve files, even those in subdirectories, without a browser with fantastic files or how to change them with the client.
Is it possible? If not, what is the minimum configuration required to perform this behavior?
Additional Information
I tried the following command. I was expecting you to be able to view the javadoc shipped with Jetty 8 with http://localhost:8080/javadoc/
, but it always gives me 404
java -jar start.jar --ini OPTIONS = Server, resources etc / jetty.xml contexts / javadoc.xml
source share