开发者

image servlet tomcat apache

开发者 https://www.devze.com 2023-01-24 05:57 出处:网络
I need some advise on the architecture. Requirment : Users need to upload and download images.开发者_如何学JAVA
 I need some advise on the architecture.

Requirment :

  1. Users need to upload and download images.开发者_如何学JAVA
  2. Secure -- Only users logged in should be able to upload/download the images.
  3. Scalable.
  4. Load the image from a location independent of the App server location. the content could be stored on shared drives.

Different Approach, I could think of :

  1. Currently we have a prototype developed based of servlet. It works pretty well. (I am not sure if this is scalable approach though). My servlet gets the request which sets the mime type and returns the image content.

  2. Configure Apache(in front of Tomcat) to render images but I am not sure how to enable security so that only the user who uploaded the image can download.

Can you please suggest a better approach ?

thank you


I'd go for the servlet approach. If the servlet code is well written, I don't forsee scalability problems. This is more a concern of the servletcontainer itself (and the hardware used). Delegating this task to apache is doable, but keeping the authentication in sync may become a pain. I have never done it before, but in theory, your best bet would be a shared database and use mod_auth_db(m) in Apache HTTPD and JDBCRealm in Apache Tomcat.

0

精彩评论

暂无评论...
验证码 换一张
取 消