@ExtDirectMethod(value = ExtDirectMethodType.FORM_POST, group = "group2",
synchronizeOnSession = true)
public ExtDirectFormPostResult upload(@RequestParam("fileUpload") MultipartFile file,
@Valid User user, BindingResult result) throws IOException {
ExtDirectFormPostResult resp = new ExtDirectFormPostResult(result, false);
if (file != null && !file.isEmpty()) {
resp.addResultProperty("fileContents", new String(file.getBytes()));
resp.addResultProperty("fileName", file.getOriginalFilename());
}
resp.addResultProperty("name", user.getName());
resp.addResultProperty("firstName", user.getFirstName());
resp.addResultProperty("age", user.getAge());
resp.addResultProperty("e-mail", user.getEmail());
resp.setSuccess(true);
return resp;
}