Well, I think I'm pretty close to having my image upload form complete, however, I'm trying to figure out how I can maintain the uploaded image if validation errors occur upon form submit.
Basically, I do not want the end-users thinking that they must re-upload their image each time form validation fails. It would be nice if the uploading process does not occur if form validation errors occur, and even nicer if the image upload field maintained the path selected by the user.
Anyhow, here's the code I have so far:
In my Controller:
In my JSP:Code:protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor()); super.initBinder(request, binder); }
Also, in my command model, imageOne is defined as a byte[].Code:<spring:bind path="command.imageOne"> <input type="file" name="<c:out value="${status.expression}"/>" value="<c:out value="${status.value}"/>"> </spring:bind>
Any help is greatly appreciated!
Thanks,
Matt


Reply With Quote
)