Results 1 to 2 of 2

Thread: how to get a values from a multipart/form-data

  1. #1
    Join Date
    Jul 2012
    Posts
    9

    Default how to get a values from a multipart/form-data

    Multipart only getting the File upload value not for name, password. how can i get the both(file, name) value in the form..

  2. #2

    Default

    Your Form or Command Object needs to define the properties which spring will bind when request is received by the controller.

    Example:
    <code>
    public class MyFormObject{
    private MultipartFile file;
    private String username;
    private transient password;

    //getter and setters here
    }
    </code>

    Then in the view ( ie. jsp for example) have the input fields that map to MyFormObject properties which spring will bind for you.

Posting Permissions

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