Does Spring framework support Jersey API
I am using Uploadify on a JSP for multi file upload and Spring MVC framwork on the serve开发者_如何学Gor-side. Can the Spring Controller class support Jersey API to upload the file on the server-side. I am currently using Apache Commons FileUpload for uploading the files but it is breaking for larger files with more than 20 MB size. Can I use Jersey instead? Any help is appreciated.
Jersey is a RESTful framework. SpringMVC is REST-like mvc framework. I don't think you need to mix them. Furthermore, SpringMVC has its own file-upload support. Look here for 5.8 Spring's multipart (fileupload) support
Spring MVC uses Apache Commons FileUpload as well - out of the box (see doc). Did you configure correctly the CommonsMultipartResolver in your *-servlet.xml configuration file (could you edit your question and add part of your spring config)?
My best guesses for your problem (depending on the maximum size of attachments for your application):
- you may need to configure your MultipartResolver properly (thus setting correct values for the underlying apache fileupload instance). See CommonsMultipartResolver and CommonsFileUploadSupport.
- and/or configure your tomcat server with maxPostSize
- tweak your JVM memory arguments (-Xmx ...)
精彩评论