This code is a RestEasy code for handling upload:
@Path("/fileupload")
public class UploadService {
@POST
@Path("/upload")
@Consumes("multipart/form-data")
public Response create(@MultipartForm FileUploadForm form)
{
// Handle form
}
}
Is there anything similar using Spring that can handle MultipartForm just like this?
Spring includes has a multipartresolver that relies on commons-fileupload, so to use it you have to include it in your build.
In your applicationContext.xml
In your controller, use org.springframework.web.multipart.MultipartFile.