I want to return a `boolean` value from my Java class to the Ajax request. The value is successfully passed from the ajax to the java method but can't return a `boolean` value back to Ajax. I am getting an error: `unknown return value type`.

```
@RequestMapping(value="/availability", method=RequestMethod.POST)
public boolean emailAvailability(String email) {
    boolean a = true;
    Query q = new Query("UserDetailsNew");
    PreparedQuery pq = ds.prepare(q);

    System.out.println("email in availability : " + email);

    for (Entity e : pq.asIterable()) {
        String Email = (String) e.getProperty("Email");
        if (Email.equals(email)) {
            a = false;
            return a;
        }
    }
    return a;
}

```

My Ajax Code :

```
var email = $("#email").val();
    $.ajax({
          method:"post",
          url:"/availability",
          dataType: 'JSON',
          data:{ email: JSON.stringify(email) },
          success : function (data){
          console.log(data);
          if(!data){
              $("#email").focusout(function(){
                    $('#submit').prop('disabled',true);
                    $('.status').html("Email already taken...");
                });
          }
          else {
              $('.status').html("Email Available...");
              $('#submit').prop('disabled',false);
          }
         } 
    });

```