Jersey not loading index.html

Biscuit128

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="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

    <module-name>restprj</module-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>SpringApplication</servlet-name>
        <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>javax.ws.rs.Application</param-name>
            <param-value>com.rest.test.demo.MyApplication</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>SpringApplication</servlet-name>
        <url-pattern>/service/*</url-pattern>
    </servlet-mapping>
</web-app>

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

http://localhost:8080/service/entry-point/test2/hi

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?

Thanks

Zeus

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

javascript not loading on index.html page

From Dev

Jersey endpoints fail to load if index.html is provided

From Dev

Loading a Grizzly/Jersey server in a JAR

From Dev

Header.html not loading after being included index.php

From Dev

index.html not loading even when the node server is running successfully

From Dev

AngularJS, UI Bootsrap, MVC Frontend - index.html not loading login.html in ng-view

From Dev

index.js not loading

From Dev

angular2 quick start only showing Loading .. not the content of index.html

From Dev

URL rewriting : Apache configuration to prevent loading default folder index.html

From Dev

What is the difference between loading my index html file vs. using http-server?

From Dev

Angular2: Index.html doesn't display the file, only says "loading..."

From Dev

URL rewriting : Apache configuration to prevent loading default folder index.html

From Dev

Phonegap android app in 3g or 2g connection index.html loading very slow

From Dev

My app component is not showing up just loading... from my index.html

From Dev

minify html and js in jersey Interceptor

From Dev

Expressjs - Angular loading not loading index page

From Dev

libSpatialIndex: loading/storing index on disk

From Dev

Jersey API + JPA/Hibernate Criteria Lazy Loading not working

From Dev

Jersey API + JPA/Hibernate Criteria Lazy Loading not working

From Dev

Loading HTML templates with RequireJS

From Dev

Canvas HTML loading time

From Dev

HTML not loading CSS

From Dev

Angular html not loading properly

From Dev

Image not loading in HTML

From Dev

Javascript not loading in HTML document

From Dev

HTML image is not loading?

From Dev

Static page html loading

From Dev

Map not loading into HTML page

From Dev

Image not loading in HTML canvas

Related Related

  1. 1

    javascript not loading on index.html page

  2. 2

    Jersey endpoints fail to load if index.html is provided

  3. 3

    Loading a Grizzly/Jersey server in a JAR

  4. 4

    Header.html not loading after being included index.php

  5. 5

    index.html not loading even when the node server is running successfully

  6. 6

    AngularJS, UI Bootsrap, MVC Frontend - index.html not loading login.html in ng-view

  7. 7

    index.js not loading

  8. 8

    angular2 quick start only showing Loading .. not the content of index.html

  9. 9

    URL rewriting : Apache configuration to prevent loading default folder index.html

  10. 10

    What is the difference between loading my index html file vs. using http-server?

  11. 11

    Angular2: Index.html doesn't display the file, only says "loading..."

  12. 12

    URL rewriting : Apache configuration to prevent loading default folder index.html

  13. 13

    Phonegap android app in 3g or 2g connection index.html loading very slow

  14. 14

    My app component is not showing up just loading... from my index.html

  15. 15

    minify html and js in jersey Interceptor

  16. 16

    Expressjs - Angular loading not loading index page

  17. 17

    libSpatialIndex: loading/storing index on disk

  18. 18

    Jersey API + JPA/Hibernate Criteria Lazy Loading not working

  19. 19

    Jersey API + JPA/Hibernate Criteria Lazy Loading not working

  20. 20

    Loading HTML templates with RequireJS

  21. 21

    Canvas HTML loading time

  22. 22

    HTML not loading CSS

  23. 23

    Angular html not loading properly

  24. 24

    Image not loading in HTML

  25. 25

    Javascript not loading in HTML document

  26. 26

    HTML image is not loading?

  27. 27

    Static page html loading

  28. 28

    Map not loading into HTML page

  29. 29

    Image not loading in HTML canvas

HotTag

Archive