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 Does Not Get Picked Up 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 Does Not Get Picked Up" Watch "Image Does Not Get Picked Up" New topic
Author

Image Does Not Get Picked Up

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I am using the Struts framework. I have an image and this is my image tag:

<html:img page="/HSInfo/frame/common/images/dhs-header-title.JPEG" border="0" width="800" alt="[infomation]"/>

The image does not get picked up in the browser. Therefore, only the text "information" is shown.

HSInfo is the name of my application and it is right under the $TOMCAT/webapps directory.

Because the image does not get picked up, I right click in the browser to "view source" to get a clue. The source code shows page="/HSInfo/frame/common/images/dhs-header-title.JPEG"

The image dhs-header-title.jpeg is in the folder that I specified. The spelling is correct. And the extension is .jpeg

What else could cause that the image does not get picked up?
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
Get rid of the "/HSInfo" part of your file path.

Starting a file path with a "/" means that the application will start looking for the file from your web application's root directory (which for you is HSInfo), NOT Tomcat's "webapps" folder.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Image Does Not Get Picked Up
 
Similar Threads
intersting discovery and a problem for images not showing up in JSPs
CSS and image positioning
Simple animated GIF ? - Why preloading doesn't work in IE
Image loading problem
Problem using html frames with struts and tiles