How to configure welcome file (HTML/JSP) in Jersey container

your current servlet mapping is

<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/*</url-pattern>

which redirects every request to jersey. so to make welcome page visible you need to make entry like

<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/rest</url-pattern>

this pattern will call jersey only for urls like

http://localhost:8080/rest/

and thus url

http://localhost:8080/index.html

will not be redirected to jersey servlet.

A project targetting same scenario is hosted on https://github.com/skohli0302/jims


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
    <display-name>com.webservice.services</display-name>
    <servlet>
        <servlet-name>Jersey REST Service</servlet-name>
        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>com.sun.jersey.config.property.packages</param-name>
            <param-value>com.webservice.services</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Jersey REST Service</servlet-name>
        <url-pattern>/service/*</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
</web-app>


Try URL pattern with different path like given above (/service/*) for REST. It works and welcome file displays when server starts.