This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Image Does Not Get Picked Up" Watch "Image Does Not Get Picked Up" New topic

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:
subject: Image Does Not Get Picked Up
It's not a secret anymore!