Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying images using JSP

 
Belloumi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
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
karl
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
?? 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic