This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Image loading problem" Watch "Image loading problem" New topic
Author

Image loading problem

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
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
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Image loading problem
 
Similar Threads
c:forEach tag
Downloading Excel file in jsp
JSTL does not show values
jsp:include inside c:forEach
getOutputStream() has already been called for this response