try {
photo.processImage();
} catch (UnableToProcessTheImage e) {
actionMessages.add("unableToProcessImage", new ActionMessage("errors.unableToProcessImage"));
saveMessages(request, actionMessages);
photo.deleteTemporaryFiles();
return prepare(mapping, actionForm, request, response);
}
photo.createTemporaryFiles();
request.setAttribute("preview", true);