File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes File structure query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "File structure query" Watch "File structure query" New topic
Author

File structure query

Mark Howard
Ranch Hand

Joined: Feb 14, 2001
Posts: 285
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 ]
Anton Rechenauer
Greenhorn

Joined: Dec 23, 2003
Posts: 13
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 ]

AR
Mark Howard
Ranch Hand

Joined: Feb 14, 2001
Posts: 285
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: File structure query