title: How we can read document information on spring mvc & mongodb
body: <p>I am trying to get one person record on mongodb with spring mvc using ajax call.</p>
  
  <p>this is ajax code in index.jsp:</p>
  
  <pre><code>    $(document).on("click","a.edit",function(){
          var id=this.id;
  
          $.ajax({
              url:"edit.htm",
              data:{id:id},
              success:function(response){
                  alert(response); 
              }
          });
      });
  </code></pre>
  
  <p>This is PersonService Class  get method:</p>
  
  <pre><code>public Person getPerson(String id) {
      return mongoOperations.findOne( Query.query(Criteria.where("_id").is(id)),
                                  Person.class,
                                  COLLECTION_NAME) ;
  } 
  </code></pre>
  
  <p>This is ajaxEditPerson method in PersonController Class:</p>
  
  <pre><code>@RequestMapping(value = "/edit", method = RequestMethod.GET)
  public @ResponseBody String ajaxEditPerson(
         @ModelAttribute Person person, 
         ModelMap model,
         @RequestParam(value="id") String id) {
  
        model.addAttribute("personOne", personService.getPerson(id));
  
       return "test";
  }
  </code></pre>
  
  <p>I want to get person infos in index.jsp using ETL:</p>
  
  <pre><code>${personOne.name}
  </code></pre>
  
  <p>But it doesnt send response to index.jsp.</p>
  
  <p>How can I fix this?</p>
  
  <p>Thanks</p>