Two Laptop Bag
The moose likes Servlets and the fly likes Displaying images using JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Displaying images using JSP" Watch "Displaying images using JSP" New topic

Displaying images using JSP


Joined: May 28, 2001
Posts: 5
Hi again,
Well I am new to JSP so just bare with me. I am trying to open a JSP file, but when I do the images, which I've on the page are not showing. Actually even when I click on the images directly when I am on http://localhost:8080/images I keep on getting page not found. Is there any way to get the images to be shown.
Thanks in advance
karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
make sure you've set the context for your images.
eg. in tomcat you have the server.xml in the TOMCAT_HOME/conf directory. open this with texteditor and take a look at it. you can see from the existing contexts how you should define your new contexts.... hope this helps
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

?? images shouldn't need a separate context.

It might be a mistake in the HTML. If the page displays, but the images are the typical box with a little red 'x', then make sure the <img src="/images/image1.gif"> tag is correct. In this example, you'd need an images directory under the <webaps>/<webroot> directory.
I agree. Here's the link:
subject: Displaying images using JSP
It's not a secret anymore!