How to process a multipart request consisting of a file and a JSON object in Spring restful service?
I have the following resource (implemented using Spring 4.05.RELEASE) which accepts a file and a JSON object: (P.S. activityTemplate is a serializable entity class) ... @RequestMapping(value="/create", method=RequestMethod.POST) public @ResponseBody ActivityTemplate createActivityTemplate( @RequestPart ActivityTemplate activityTemplate, @RequestPart MultipartFile jarFile) { //process the file and JSON } ... and this is the form I am testing from: <form method="POST" enctype="multipart/form-data" action="http://localhost:8080/activityTemplates/create"> JSON: <input type="text" name=