Mercurial > hg > LGServices
comparison src/main/webapp/methods/sectionIdAutocomplete.jsp @ 0:3e62083dbcbf
First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
| author | "jurzua <jurzua@mpiwg-berlin.mpg.de>" |
|---|---|
| date | Thu, 23 Apr 2015 15:46:01 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:3e62083dbcbf |
|---|---|
| 1 <%@page import="java.util.List"%> | |
| 2 <%@page import="de.mpiwg.gazetteer.utils.DBService"%> | |
| 3 <%@page import="org.json.JSONObject"%> | |
| 4 <%@page import="org.json.JSONArray"%> | |
| 5 <% | |
| 6 | |
| 7 String term = request.getParameter("term"); | |
| 8 List<String> list = DBService.suggestSectionId(term, 10); | |
| 9 | |
| 10 | |
| 11 JSONArray jsonArr = new JSONArray(); | |
| 12 | |
| 13 for(String item : list){ | |
| 14 JSONObject json = new JSONObject(); | |
| 15 json.put("name", item); | |
| 16 json.put("value", item); | |
| 17 jsonArr.put(json); | |
| 18 } | |
| 19 out.println(jsonArr); | |
| 20 %> |
