• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

File structure query

 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]
 
Mark Howard
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic