0

This is a question related to a similar question Deploying just HTML, CSS webpage to Tomcat.

I followed the answers there and can successfully deploy HTML+CSS for tomcat. But now I have to run an web application powered by jetty instead of tomcat.

My question is, is it possible, and how to deploy just HTML and CSS to a custom location with jetty? (I am using Lubuntu/Ubuntu 14.04).

Thanks in advance

Community
  • 1
  • 1
thor
  • 20,736
  • 28
  • 83
  • 160

1 Answers1

2

With Jetty 9, the process is super simple.

In your {jetty.base}/webapps/ directory create a sub-folder that will house your static file content and put your HTML/CSS in there.

Note that the name of the directory is used to determine the contextPath of your resulting webapp. (The special case name ROOT will deploy to /)

Eg:

$ cd /opt/web/mybase
$ mkdir -p webapps/public
$ cd webapps/public
$ cp -R /home/user/Downloads/static-web-content/ .
$ ls
index.html
flower.jpg
site.css

Now you can access that content via urls like http://localhost/public/flower.jpg

Joakim Erdfelt
  • 44,704
  • 6
  • 87
  • 132