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?