public void uploadTest(HttpServletRequest request,
@RequestParam("fileUpload") MultipartFile file,
final HttpServletResponse response, @Valid User user, BindingResult result)
throws IOException {
ExtDirectResponseBuilder builder = new ExtDirectResponseBuilder(request, response);
if (file != null && !file.isEmpty()) {
builder.addResultProperty("fileContents", new String(file.getBytes()));
builder.addResultProperty("fileName", file.getOriginalFilename());
}
builder.addErrors(result);
builder.addResultProperty("name", user.getName());
builder.addResultProperty("firstName", user.getFirstName());
builder.addResultProperty("age", user.getAge());
builder.addResultProperty("email", user.getEmail());
builder.successful();
builder.buildAndWrite();
}