Results 1 to 2 of 2

Thread: lack of CommonsMultipartFile.toString() implementation?

  1. #1
    Join Date
    Nov 2004
    Posts
    15

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    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
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

Similar Threads

  1. Replies: 2
    Last Post: May 4th, 2005, 10:39 PM
  2. Spring code remarks
    By Alarmnummer in forum Architecture
    Replies: 18
    Last Post: Apr 7th, 2005, 07:17 AM
  3. Other Hibernate DAO LazyInitializationExceptions
    By bernardsirius in forum Data
    Replies: 5
    Last Post: Feb 18th, 2005, 04:09 PM
  4. Replies: 9
    Last Post: Feb 8th, 2005, 09:25 PM
  5. Replies: 4
    Last Post: Nov 16th, 2004, 02:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •