title: How to pass the submitted form data along with multipartfile(image) upload and save the data to a javabean on the controller end Spring MVC
body: <pre><code>My Html Content
  &lt;form role="form" name="frm1" action="http://localhost:8080/aricloud/rest/usermgmt/signup" id="signup" method="POST" enctype="multipart/form-data"&gt;
  
    &lt;div class="form-group"&gt;`enter code here`
      &lt;label for="username"&gt;Login Name&lt;/label&gt;
      &lt;input type="text" class="form-control" name="userName" id="username" placeholder="Enter Username" value="vindu525"&gt;
    &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
      &lt;label for="password"&gt;Password&lt;/label&gt;
      &lt;input type="password" class="form-control" name="password" id="passwd" placeholder="Password" value="12345"&gt;
    &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
      &lt;label for="confirm_password"&gt;Confirm Password&lt;/label&gt;
      &lt;input type="password" class="form-control" name="confirmPassword" id="confirmpasswd" placeholder="Please enter Password again" value="12345"&gt;
    &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
      &lt;label for="email"&gt;Email address&lt;/label&gt;
      &lt;input type="email" class="form-control" name="emailID" id="emailID" placeholder="Enter email" value="vindu525@gmail.com"&gt;
    &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
      &lt;label for="mobile"&gt;Mobile No&lt;/label&gt;
      &lt;input type="text" class="form-control" name="mobileNumber" id="mobileNumber" placeholder="Enter email" value="9584315174"&gt;
    &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
      &lt;label for="country"&gt;Country&lt;/label&gt;
      &lt;input type="text" class="form-control" name="country" id="country" placeholder="Enter country" value="india"&gt;
    &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
      &lt;label for="country"&gt;File Upload&lt;/label&gt;
      &lt;input type="file" class="form-control" name="image" id="image" &gt;
    &lt;/div&gt;
  
  &lt;input type="hidden" class="form-control"  name="userAvatar" id="userAvatar" value="null"/&gt;
  
    &lt;button id="regsubmit" type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <hr>
  
  <p>My Controller </p>
  
  <pre><code>public ResponseEntity&lt;String&gt; addUser(@RequestBody UserDetailsBean user,
              @Context HttpServletRequest request,
              @Context HttpServletResponse response
              ) {
  //File handling and other logic goes here 
  }
  </code></pre>
  
  <hr>
  
  <p>UserDetailsBean contains the setter and getter methods for all the form data including the image</p>
  
  <hr>
  
  <p>When I post the data I get the below error
   415 (Unsupported Media Type)</p>
  
  <p>Though the individual file and content upload works when I try to integrate the multipartfile with the userdetails bean it gives me an error.</p>