title: Getting 400 Bad Request after using date function field in jsp/controller
body: <p>I am getting HTTP 400 bad request error when i tried to use date in my application. It was works fine without date but with date it gives 400 error. Is there any way i can get rid of this error.</p>
  
  <p><strong>Controller class</strong></p>
  
  <pre><code>@RequestMapping(value = "/createfeedback", method = RequestMethod.POST)
  public String postcreatefeedback(@ModelAttribute("feedback") Feedback feedback,  Locale locale, HttpServletRequest req, Map&lt;String, Object&gt; map) {
      logger.info("Welcome to Create Feedback page ! POST Method : The client locale is {}.", locale);
      Feedback check = feedbackService.getFeedback(feedback.getName());
  
      String email = req.getParameter("email");
      if (check == null) {
          feedback.setUser(userService.userExists(email.substring(2)));
          feedback.setCreated();
          feedbackService.addFeedback(feedback);
          logger.debug("Feedback Created");
          return "redirect:feedbackmanager.html";
      } else {
          logger.error("Feedback name already exists");
          return "redirect:createfeedback.html";
      }
  }
  </code></pre>
  
  <p><strong>Feedback Class</strong> </p>
  
  <pre><code>@Entity @Table(name="feedback")
  public class Feedback {
  
      @Id @Column @GeneratedValue(strategy=GenerationType.AUTO)
      private int id;
  
      @Column(name="feedback_name")
      private String name;
  
      @Temporal(TemporalType.TIMESTAMP)
      @DateTimeFormat(pattern="dd.MM.yyyy hh:mm")
      @Column(name = "created")
      private Date created;
  
      @DateTimeFormat(pattern="dd.MM.yyyy hh:mm")
      @Column(name = "date_from")
      private Date date_from;
  
      @DateTimeFormat(pattern="dd.MM.yyyy hh:mm")
      @Column(name = "date_to")
      private Date date_to;
  
      @ManyToOne
      @JoinColumn(name="subject_id")
      private Subject subject;
  
      @ManyToOne
      @JoinColumn(name="user_id")
      private User user;
  
      @ManyToOne
      @JoinColumn(name="question_set_id")
      private Question_Set question_set;
  
      //Setter and Getter
  }
  </code></pre>
  
  <p><strong>JSP Page</strong> </p>
  
  <pre><code>&lt;tiles:insertDefinition name="adminTemplate"&gt;
      &lt;tiles:putAttribute name="body"&gt;
          &lt;link rel="stylesheet" href="http://tarruda.github.io/bootstrap-datetimepicker/assets/css/bootstrap-datetimepicker.min.css" type="text/css"/&gt;
  
          &lt;script src="http://tarruda.github.io/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
          &lt;div class="col-sm-9"&gt;
  
          &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;&lt;spring:message code="app.panel.title.createfeedback" /&gt;&lt;/div&gt;
                  &lt;div class="panel-body"&gt;
                      &lt;form:form commandName="feedback"&gt;
                          &lt;form:errors path="*" cssClass="errorblock" element="div" /&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-sm-8"&gt;
                                  &lt;div class="row"&gt;
                                      &lt;div class="col-sm-4"&gt;
                                          &lt;label for="name"&gt;&lt;spring:message code="app.form.name" /&gt;&lt;/label&gt;
                                      &lt;/div&gt;
                                      &lt;div class="col-sm-7"&gt;
                                          &lt;form:input cssClass="form-control" path="name" /&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;br /&gt;
                                  &lt;div class="row"&gt;
                                      &lt;div class="col-sm-4"&gt;
                                          &lt;label for="question_set"&gt;&lt;spring:message
                                                  code="app.panel.questionset" /&gt;&lt;/label&gt;
                                      &lt;/div&gt;
                                      &lt;div class="col-sm-7"&gt;
                                          &lt;div class="row"&gt;
                                              &lt;div class="col-sm-8"&gt;
                                                  &lt;form:select class="form-control" path="question_set.id"&gt;
                                                      &lt;c:forEach items="${questionsetList}" var="questionset"&gt;
                                                          &lt;option value="${questionset.id}"&gt;${questionset.name}&lt;/option&gt;
                                                      &lt;/c:forEach&gt;
                                                  &lt;/form:select&gt;
                                              &lt;/div&gt;
                                              &lt;div class="col-sm-4"&gt;
                                                  &lt;a href="questionsetmanager.html"
                                                      class="btn btn-sm btn-primary col-sm-12"&gt; &lt;spring:message
                                                          code="app.panel.questionset" /&gt;&lt;/a&gt;
                                              &lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;br&gt;
                                  &lt;div class="row"&gt;
                                      &lt;div class="col-sm-4"&gt;
                                          &lt;label for="date_from"&gt;&lt;spring:message code="app.panel.datefrom" /&gt;&lt;/label&gt;
                                      &lt;/div&gt;
                                      &lt;div class="col-sm-7"&gt;
                                          &lt;div id="datetimepicker1" class="input-group date"&gt;
                                              &lt;form:input path="date_from" data-format="dd/MM/yyyy" type="text" class="form-control" /&gt;
                                              &lt;span class="add-on input-group-addon"&gt; 
                                                  &lt;i data-time-icon="icon-time" data-date-icon="glyphicon glyphicon-calendar"&gt; &lt;/i&gt;
                                              &lt;/span&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                      &lt;script type="text/javascript"&gt;
                                          $(function() {
                                              $('#datetimepicker1')
                                                      .datetimepicker({
                                                          language : 'en',
                                                          pick12HourFormat : true
                                                      });
                                          });
                                      &lt;/script&gt;
                                  &lt;/div&gt;
                                  &lt;br&gt;
                                  &lt;div class="row"&gt;
                                      &lt;div class="col-sm-4"&gt;
                                          &lt;label for="date_to"&gt;&lt;spring:message code="app.panel.dateto" /&gt;&lt;/label&gt;
                                      &lt;/div&gt;
                                      &lt;div class="col-sm-7"&gt;
                                          &lt;div id="datetimepicker2" class="input-group date"&gt;
                                              &lt;form:input path="date_to" data-format="dd/MM/yyyy" type="text" class="form-control" /&gt;
                                              &lt;span class="add-on input-group-addon"&gt; 
                                                  &lt;i data-time-icon="icon-time" data-date-icon="glyphicon glyphicon-calendar"&gt; &lt;/i&gt;
                                              &lt;/span&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                      &lt;script type="text/javascript"&gt;
                                          $(function() {
                                              $('#datetimepicker2')
                                                      .datetimepicker({
                                                          language : 'en',
                                                          pick12HourFormat : true
                                                      });
                                          });
                                      &lt;/script&gt;
                                  &lt;/div&gt;
                                  &lt;br&gt;
  
                                  &lt;div class="row"&gt;
                                      &lt;div class="col-sm-4"&gt;
                                          &lt;label for="subject"&gt;&lt;spring:message
                                                  code="app.panel.subject" /&gt;&lt;/label&gt;
                                      &lt;/div&gt;
                                      &lt;div class="col-sm-7"&gt;
                                          &lt;div class="row"&gt;
                                              &lt;div class="col-sm-8"&gt;
                                                  &lt;form:select class="form-control" path="subject.id"&gt;
                                                      &lt;c:forEach items="${subjectList}" var="subject"&gt;
                                                          &lt;option value="${subject.id}"&gt;${subject.name}&lt;/option&gt;
                                                      &lt;/c:forEach&gt;
                                                  &lt;/form:select&gt;
                                              &lt;/div&gt;
                                              &lt;div class="col-sm-4"&gt;
                                                  &lt;a href="subjectmanager.html"
                                                      class="btn btn-sm btn-primary col-sm-12"&gt;&lt;spring:message
                                                          code="app.panel.subject" /&gt;&lt;/a&gt;
                                              &lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;br&gt; &lt;br /&gt;
                                  &lt;br /&gt;
                                  &lt;div class="row"&gt;
                                      &lt;div class="col-sm-4"&gt;
                                          &lt;input type="hidden" name="email" value="${loggedInUserEMAIL}"/&gt;
                                          &lt;button type="submit"
                                              class="btn btn-sm btn-success form-control"&gt;
                                              &lt;spring:message code="app.btn.save" /&gt;
                                          &lt;/button&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/form:form&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
       &lt;/div&gt;
      &lt;/tiles:putAttribute&gt;
  &lt;/tiles:insertDefinition&gt;
  </code></pre>