I am implementing an API with Jersey 2.22.2, with the following exemplary GET URL:
http://example.com/api/users
Calling this URL returns, e.g., a list of users in JSON.
Now I want to be able to serve static content from the URL root, i.e.,
http://example.com/api/
I've included a simple index.html file in /webapps/
, next to WEB-INF
, and it gets built into the root of the WAR successfully.
However, when I navigate to http://example.com/api/
or http://example.com/api/index.html
, I get a 404.
How can I configure web.xml
or the servlet itself, to serve static content from the app root?