title: Spring MVC and AJAX error
body: <p>In JSP file I have field to enter student's group and then pass this data to entity class GroupStudent (without getter and setter methods)</p>
  
  <pre><code>@Entity
  @Table(name = "GroupStudent")
  @NamedQueries({ 
  @NamedQuery(name = "GroupStudent.getAllGroups", // get all groups
              query = "select g from GroupStudent g"),
  @NamedQuery(name = "GroupStudent.getGroupByName", // get group by name
              query = "select g from GroupStudent g where g.groupStudentNumber = :name")
  })
  public class GroupStudent implements Serializable {
  public GroupStudent() {}
  
  public GroupStudent(String groupStudentNumber) {
      this.groupStudentNumber = groupStudentNumber;
  }
  // table GroupStudent fields
  private Long groupStudentId;
  private String groupStudentNumber;
  }
  </code></pre>
  
  <p>JSP</p>
  
  <pre><code>&lt;label&gt;Group&lt;/label&gt;
  &lt;input id="groupStudentNumber"/&gt;
  &lt;input type="submit" value="Add" onclick="addGroupAjax()" /&gt;
  </code></pre>
  
  <p>and ajax function to pass data to Spring Controller</p>
  
  <pre><code>function addGroupAjax() {
              var groupStudentNumber = $('#groupStudentNumber').val();
  
              $.ajax({
                  type: "POST",
                  url: "/IRSystem/addData.html",
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  data: "{groupStudentNumber:" + groupStudentNumber + "}",
                  success: function(response) {
  
                  },
                  error: function(e) {
                      alert("Error" + e);
                  }
              });
          } 
  </code></pre>
  
  <p>but it do not pass data to controller. The field of the entity is empty.</p>
  
  <pre><code>@RequestMapping(value = "/addData.html", method = RequestMethod.POST)
  public @ResponseBody Student addNewGroup(@ModelAttribute(value = "group") GroupStudent group) {
  
      System.out.println("Entered group: " + group.getGroupStudentNumber());
  
      return new Student();
  }
  </code></pre>
  
  <p>and another thing that i can not pass entity Student to ajax too. I added to Spring jars</p>
  
  <p>jackson-core-asl-1.7.1 and jackson-mapper-asl-1.7.1 to be able to pass entity object to ajax. But it gave not result. When i try to pass data (to ajax) in Google Chrome I have a window with error Error[object Object].
  I do not know why it happens. I would appreciate any information, thank you.</p>