Take the 2-minute tour ×

Some basic structure of My web application :

  1. Front-end - jQuery,bootstrap
  2. Server - jsp,Spring MVC,Spring JdbcTemplate
  3. DB - Mysql

I have no problem in uploading files with Spring's CommonsMultipartResolver.Now I want implement a feature (or a sub module) that like wordpress's Media Manager.I only need basic features such as upload file,download file,link to file,delete file,search file list by directory etc.

I have tried to look for some related open source java library,but I failed.So I have to do it myself.Now I encountered some problems(below),hope someone can help me.

  1. is there some useful open source java library that provides features I mentioned?
  2. I want process file centralized,such as using a spring interceptor or a FileManagerController.I describes the workflow of upload:

    1. user request formPage
    2. user choose a file
    3. ajax upload
    4. FileManagerController#upload and return the key(generated by uuid,md5,filename,fileRelativeDirectory etc..) of file.
    5. response some upload information(such as key,success,error)
    6. put the file key to a hidden form field
    7. submit
    8. save or update data(contains business data and file key) to database

    The upload requirements of different business are different,example moduleA allow upload any type of file,while moduleB allow upload image file only.Maybe there is different max upload size limit.so I want make it configurable.every upload requirement should config some properties,such as allowable file types,max upload size,upload path etc..

    Does the idea have problems? I think things complicated? Are there some best practices about upload?

  3. business process should roll back when upload failed,however I separate upload process and business process,I don't know how to maintain the transaction well.If I ignore the problem,This can lead to some inconsistent results.Is my design wrong? I'm looking for trouble?

share|improve this question
who can give me some advice.Thanks –  hidmouth Mar 26 at 7:31

Your Answer



Browse other questions tagged or ask your own question.