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 8664353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:13:16+00:00 2026-06-12T17:13:16+00:00

I have a java webservice (jaxws /jersey) and want it to display an image

  • 0

I have a java webservice (jaxws /jersey)
and want it to display an image on the firstpage
when I visit the webservice using the browser.

My @GET Method which’s sending the html-code for the first page is as follows:

@GET
@Produces(MediaType.TEXT_HTML)
public String getHTMLSite(){

    String message = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"+
            "<html xmlns=\"http://www.w3.org/1999/xhtml\" dir=\"ltr\" lang=\"de-DE\">" +
            "<div style=\"padding-left:20px; height:200px; width:800px; font-size:20px;\">" +
                "<p>" +
                    "<h1 style=\"color:#313e7d\">" +
                        "Hello World. This is a Webservice URL" +
                    "</h1>" +
                "</p>"+
                "<img src=\"/images/img_logo.gif\" height=\"51\" width=\"537\"/>"+
            "</div>"+
            "</html>";


    return  message;
}

Everything is working fine except the image

<img src=\"/images/img_logo.gif\" height=\"51\" width=\"537\"/>

has not been found.

I moved the image into the WebContent / images/ directory.

What am I doing wrong?

  • 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-12T17:13:17+00:00Added an answer on June 12, 2026 at 5:13 pm

    Since you’ve got your servlet-mapping set to /* Jersey is going to intercept all those requests to static resources and not know what to do with them. You could:

    • Move the location of your servlet-mapping to /api/* or something similar. This will resolve the static resource issue but will move the end point of all your REST calls.

    • Switch to the Jersey filter as described in this answer: Jersey /* servlet mapping causes 404 error for static resources

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WebService in Java (Using Apache Axis) that get's the id of
I have created one application in flex that is accessing the Java webservice using
I have an ASP.NET Webform which currently calls a Java WebService. The ASP.NET Webform
I have devoloped a WebService (WS1) in Java which is deployed in a Tomcat
I have a legacy Java webservice based on Axis2. This webservice classes consist of:
I have a Java web-service which currently runs on a local tomcat server. I
I want to consume a web service in Java and I am using JAX.WS.
I've got a JAX-WS WebService that is using Spring 3 IOC. I have coded
I am trying to invoke method via webservice (SOAP) I have generated Web service
I'm using NetBeans 6.9.1 on Mac OS X 10.6.4 with Java 1.6.0_22. I have

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.