Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8220577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:34:11+00:00 2026-06-07T13:34:11+00:00

I am implementing a Restful Web Service using Jersey. I want to show index.jsp

  • 0

I am implementing a Restful Web Service using Jersey. I want to show index.jsp as welcome page.

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Rest Page</title>
    </head>
    <body>
        <h1>Rest is working!</h1>
    </body>
</html>

It works fine when I use this code in my web.xml:

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

  <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

The problem is when the user-pattern is like this:

<url-pattern>/*</url-pattern>

Everything works fine except welcome page. I appreciate Any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T13:34:12+00:00Added an answer on June 7, 2026 at 1:34 pm

    I found an alternative way to do this. instead of using index.jsp, I can use a class like:

    @Path("/")
    public class Hello {
    
        // This method is called if HTML is request
        @GET
        @Produces(MediaType.TEXT_HTML)
        public String sayHtmlHello() {
           return "<html> " + "<title>" + "Rest Page" + "</title>"
              + "<body><h1>" + "REST is Working!" + "</body></h1>" + "</html> ";
    }
    

    In web.xml I do not need to use:

    <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    

    And it works fine with:

    <url-pattern>/*</url-pattern>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am implementing a RESTful Web Service using Jersey. I use hibernate to communicate
I am implementing a Restful Web Service using Jersey. I have a package using
I want to implement spring security on a jersey Restful web service, both on
I am implementing a Restful Web Service in java (JAX-RS) using Jesey. I run
I am developing an iPhone application using restful web service.I want to implement splash
I'm implementing a RESTful web service in python and would like to add some
I have succesfully implemented a RESTful Web Service using the .NET 4.0 framework with
The scenario is: I'm implementing a RESTful web-service that will act as a cache
I am exploring the idea of implementing a web service api using WCF Data
I am implementing a RESTful web service that currently handles JSON and needs to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.