Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

display images in jsp

 
Praveen Sangolli
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I need to display images in my jsp page and i don't want to set the response content type nor write it to the root directory, reason behind is, if i set the content type then i will have to fetch the image on every click and set the content type, since there are many images to be displayed i don't want to hit the database every time a request is sent for an image, and if i write it to the root then the RAM will be heavily loaded. Is there any other method to display the images, if yes then please do reply.


Thanks in Advance
 
kiran mathew
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can have a separate machine set up as an image server. Save the images to this server and while retrieving it, generate links to point to those images.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand what either a database or the RAM have to do with serving images. What stops you from keeping the images in some publicly accessible directory?

I'm also not sure what's so special about setting the content type. Some piece of code has to set it; if it's not your code, then it's the web server or servlet container.
 
BWA HA HA HA HA HA HA! Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!