Version 5.1 by Lachlan Scott on 2007/07/12 19:05

Hide last authors
Lachlan Scott 1.1 1 **Problem:** you want to add an image to the HTML page of a Component; being an highly skilled application developer with the good sense to apply your talents with WebObjects :D , you expect to do this by using the <img src=" "> tag in the HTML, and are confused as to how to achieve it in WebObjects.
2
3 **Discussion:** WebObjects provides the WOImage tag to manage images in component pages which obviates the 'img' tag, and which can be somewhat unintuitive for the beginning WO developer. The tag supports all the expected HTML img attributes as far as I can tell; needs checking and the 'filename' attribute which references the location of the image to WebObjects. The images themselves must
4
Lachlan Scott 5.1 5 **Question:** Yeah, but why can't I just make a static reference in the usual way? Well actually, you can link required, but you don't really want to explanation required: load balancing, web server resources, etc, and the WOImage tag is an elegant solution that you will come to appreciate in time; trust us, we're doctors. Well, some of us are, anyway.&nbsp;;-)
Lachlan Scott 1.1 6
Lachlan Scott 3.1 7 **Solution:**
Lachlan Scott 1.1 8
Lachlan Scott 3.1 9 1. Create a suitable image directory structure in your project
Lachlan Scott 5.1 10 1. Import the image into the directory of your choice
11 1. Add the WOImage tag to your page
12 1. Reference the image using the 'filename' attribute
Lachlan Scott 1.1 13
Lachlan Scott 3.1 14 \\
15
16 1. Create a suitable image directory structure in your project
Lachlan Scott 5.1 17 11. In Eclipse Package Explorer, right-click the project and select&nbsp; New > Folder (see image) and name the folder something appropriate such as 'images'
18 11. Proceed in this way, building the structure you want
Lachlan Scott 3.1 19
Lachlan Scott 5.1 20 In the WOLips perspective, double-click the component to which you want to add the image