Announcement Announcement Module
Collapse
No announcement yet.
lack of CommonsMultipartFile.toString() implementation? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • lack of CommonsMultipartFile.toString() implementation?

    Hi,

    using MultipartFile to upload files. Binding the value of the form field to a form object in order to do validation.

    public void setAttachment(MultipartFile attachment) {
    this.attachment = attachment;
    }

    and

    <spring:bind path="form.attachment">
    <input name="<c:out value="${status.expression}"/>" value="<c:out value="${status.value}"/>" type="file" size="40">
    <span class="textFormAlert"><c:out value="${status.errorMessage}"/></span>
    </spring:bind>


    Which results in

    <input name="attachment" value="org.springframework.web.multipart.commons.C ommonsMultipartFile@99ff91" type="file" size="40">
    <span class="textFormAlert"></span>

    I'd rather have something meaningful in the value parameter. Isn't it possible to refill the form contents as it was before the submit?

    Or should I have a completely different approach?

    Jerome

  • #2
    value="something" is usually ignored by web agents for inputs of type file as this may represent a serious security hole!!! Take a look at File input (or "upload") in HTML forms for more informations.
    HTH

    Comment

    Working...
    X