Biscuit128 Biscuit128 - 4 months ago 25
HTML Question

Jersey not loading index.html

I am having some difficulty loading an index.html with the way my project is set up - my structure looks as follows;

enter image description here

My web.xml looks as follows;

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="3.0" xmlns=""




I can call my rest end points with no issue - for example


this gives me output - however if i navigate to the url http://localhost:8080/service/ i get a 404 - it makes no difference where i place my index.html - is anyone able to point out what im doing wrong?



It looks like you are placing index.html in the /target folder, use the src/main/webapp folder for all your .js and .html files. Target folder will be cleaned up every time you mvn clean install and they will not be included in your packaging, ever.

After you make the changes, build the project, copy the war to a certain location, rename the .war to .zip, extract the contents and see if it contains the index.html file in the root folder. You may do this before and after the changes I suggested to understand how and where the index.html is packaged to.