Spring MVC - HTTP Status 400 - The request sent by the client is syntactically incorrect
<p>I am getting HTTP 400 error when I submit data through my form. Below is the code. I am not understanding where I have gone wrong.</p>

<p>Course.java</p>

<pre><code>@Entity
@Table(name="COURSES")
public class Course {

@Id
@Column(name="id", length=5, unique=true, nullable=false, updatable = false)
@GeneratedValue(strategy=GenerationType.IDENTITY)
private int id;

@Column(name="COURSE_CODE", length=20, unique=true, nullable=false)
private String courseCode;

@Column(name="COURSE_NAME", length=30, nullable=false)
private String courseName;

@Column(name="COURSE_DESCRIPTION", length=200)
private String courseDescription;

//getters and setters
</code></pre>

<p>CourseController.java</p>

<pre><code>@RequestMapping(value = "/courses/add", method = RequestMethod.GET)
public String addCoursePage(WebRequest request, ModelMap model) {
    Course course = new Course();
    model.addAttribute("course", course);
    return "addCourse";
}

@RequestMapping(value= "/courses/save", method = RequestMethod.POST)
public String saveCourse(@Valid @ModelAttribute("course") Course r, BindingResult result){

    if (result.hasErrors()) {
        return "redirect:/courses/list";
    }

    this.courseService.addCourse(r);

    return "redirect:/courses/list";        
}

@RequestMapping(value = "/courses/list", method = RequestMethod.GET)
public String coursesListPage(ModelMap model) {
    model.addAttribute("coursesList", this.courseService.listAllCourses());
    return "courseList";
}
</code></pre>

<p>addCourse.jsp</p>

<pre><code>&lt;div&gt;
&lt;c:url var="saveAction" value="/courses/save" &gt;&lt;/c:url&gt;
&lt;form:form modelAttribute="course" action="${saveAction}" method="POST"&gt;
&lt;tr&gt;
&lt;td&gt;
    &lt;form:input type="hidden" path="id" /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;&lt;label&gt;&lt;spring:message text="Course Code"&gt;&lt;/spring:message&gt;&lt;/label&gt; 
            &lt;form:input path="courseCode" /&gt;            
    &lt;/td&gt;
    &lt;form:errors path="courseCode"/&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;&lt;label&gt;&lt;spring:message text="Course Name"&gt;&lt;/spring:message&gt;&lt;/label&gt;
            &lt;form:input path="courseName" /&gt;
    &lt;/td&gt;
    &lt;form:errors path="courseName"/&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;&lt;label&gt;&lt;spring:message text="Course Description"&gt;&lt;/spring:message&gt;
        &lt;/label&gt;
    &lt;/td&gt;
    &lt;td&gt;&lt;form:input path="courseDescription" /&gt;&lt;/td&gt;
    &lt;form:errors path="courseDescription" /&gt;
&lt;/tr&gt;       
 &lt;tr&gt;
    &lt;td&gt;
            &lt;input type="submit"
                value="&lt;spring:message text="Add course"/&gt;" /&gt;
    &lt;/td&gt;
&lt;/tr&gt;
&lt;/form:form&gt;
&lt;/div&gt;
</code></pre>