File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Image loading problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Image loading problem" Watch "Image loading problem" New topic

Image loading problem

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 751
Hi, I'm trying to load an image from a servlet. However, the image won't load... When I try to invoke the servlet URL on the browser, it does load... But within the <img> tag, it doesn't... What could be wrong? Here's my Action class...

and here's my JSP...

Please help... Thanks!

SCJP 1.5
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Do you get a missing image icon in your browser (a red X in IE I think). If so, right click on that and check the properties (or view source). Does the full URL look correct? Have you tried using the html:img tag and using the page property? This will prepend the context path to the URL.

- Brent
I agree. Here's the link:
subject: Image loading problem
It's not a secret anymore!