I am planning to develop e-commerce application with tomcat server. Kindly suggest where i need to save images and how to serve images to applicaiton.
-
1Maybe like: http://stackoverflow.com/questions/2523262/how-to-serve-static-content-from-tomcat ? Your question lacks details and I get the feeling that you need to dive more into the topic yourself before you can ask the right question. – zapl Apr 22 '16 at 10:47
-
There are so much possible answers to your question. You need to be more precise and show that you did some personal searches before creating a new question on SO. – enguerran Apr 22 '16 at 10:51
2 Answers
you can save images in your project path
,
you can save them in your local machine
,
you can save them in the database
too.
i prefer to save the imagepath in database and then load the image to the application by getting the image from that location.
there are somany ways that you can extract image from a location
you have to be fammiliar with filereading , bufferedimage ,filewriting using java base64 encoding and decoding technologies so that you can send an image in a string format.
you should start coding the application and then post the problems that you've got

- 2,919
- 2
- 25
- 52
Since this question is highly opinion based so here comes my opinion. If I were you developing an ecommerce application, I would rather put my images on cdn than keeping them in my application since ecommerce applications are supposed to have a lot of images and it can weigh a lot while you package your application. So, it's better to have images at separate location (recommended cdn since they have their own caching) to make efficient use of them.