Announcement Announcement Module
Collapse
No announcement yet.
how to get a values from a multipart/form-data Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment

    Working...
    X