jQuery Tokeninput を使用してユーザーのメールを表示していますが、実際にはユーザーを招待しようとしています。入力テキストをクリックして電子メールを入力すると、その電子メールが存在する場合でも常に結果が表示されません。
私のJSは
<script type="text/javascript">
$(document).ready(function() {
var url = "http://localhost:9000/api/customers"
$("#members").tokenInput(url, {
theme: "facebook"
});
});
</script>
私のコントローラーアクションは
public static Result apiCustomers(){
List<Customer> customerList = Model.coll(Customer.class).find().toArray();
List<String> emails = new ArrayList<String>();
for(Customer c : customerList){
emails.add(c.email);
}
ObjectNode result = Json.newObject();
result.put("emails", Json.toJson(emails));
return ok(result);
}
テキスト入力を入力すると、apiCustomer アクションが呼び出され、有効な json 文字列のような応答が返されます
{"emails":["abc@gmail.com","xyz@gmail.com","asd@gmail.com","bob@gmail.com"]}
前もって感謝します