Paul Clapham wrote:I see, I didn't read your original post carefully enough. So you didn't write a servlet to handle requests for the uploaded images. Did you consider doing that and reject that on the basis that you could somehow persuade the container to handle those requests? You might find that writing the image-serving servlet makes many of your questions go away, or at least allows you to reformulate them into something which is easier to answer.
Paul Clapham wrote:I don't see why you should be implementing a cache for these images when you could perfectly well make use of the caching feature of the browsers who access your application.
You can override the "long getLastModified(HttpServletRequest req)" method of the servlet which returns the image to return the time that the image was uploaded; this will cause browsers to cache the image.
Kathleen Angeles wrote:What happens to the images in memory if you restart your server? Are you going to reload all images from the db during the startup of the server?
It sounds like reinventing the cache system.
You may opt to use a cache implementation out there (e.g. ehcache).
Banu Chowdary wrote:
Can anyone explain this? I didn't understand this.
Ankit Garg wrote:Ronald you are correct. But I was trying to show that only primitive 1D arrays nherit from Object class. Rest arrays are sub classes of Object[]. So you cannot write this
Object[] arr = new int[5]; //error
This also means that all the multi dimensional arrays are descendants of Object[]. Let me draw the diagram again for completeness
Ankit Garg wrote:let me give you a sample hierarchy to make it simple
Punit Singh wrote:
(L5) String object with content "abcdef " created.
String object with content "abcdef abcdef" created.
I did not get this one Ronald.