Forums Register Login

File structure query

+Pie Number of slices to send: Send
What is the best way to configure your web app directory structure? I currently have a simple setup as follows:



When the JSP requires an image file, it references the 'image' directory as '../images.ddd.gif'. This works, but I find that the image is never cached, and downloaded from the server each time. I thought this may have something to do with the way in which my webapp directory is structured ('coz I've tried everything else )

Should the images directory perhaps be below the jsp directory, so that it does not require the '../' to reference an image? Or should the full URL path be supplied in the JSP to the desired image (as I've noticed is done by the Javaranch site)?

Any help would be appreciated
[ December 11, 2004: Message edited by: Mark Howard ]
+Pie Number of slices to send: Send
 

This works, but I find that the image is never cached,



IMHO the directory structure has nothing to do with this phenomenon.

which servlet-container? is there a default servlet??

behind a proxy? ajp-connector?
[ December 11, 2004: Message edited by: Anton Rechenauer ]
+Pie Number of slices to send: Send
The servlet container is Resin. Whether I'm testing it locally on my home workstation or whether I download the site from my host server, the result is the same. Nothing appears to cache other than the html pages themselves.

Each image, js file, css file, etc that is downloaded has an expiry date stamped on it in my 'temporary-internet-files' folder of the same time it was downloaded, which I suspect is used for comparison purposes when I next download the same image, js, css, etc file. When I download other sites, this expiry date is null, which makes me suspect its something to do with the way I'm referencing these external files from within my JSP.

I'm at a loss. I've seen many queries on this site where people are trying hard to prevent the browser from caching objects, but I would dearly love it to do just that. Just one image at least
[ December 11, 2004: Message edited by: Mark Howard ]
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1318 times.
Similar Threads
stroing and displaying images
JSP with CSS does not display the background image
Writing image into WAR?
Regd.Document root
images in Tomcat
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:00:45.