Mercurial > hg > LGServices
comparison src/main/webapp/methods/fullTextSearchLevel1Autocomplete.jsp @ 59:bc0219c2600b
new: minor improvements
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Mon, 09 May 2016 16:02:32 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 58:b8ad346e39a0 | 59:bc0219c2600b |
|---|---|
| 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 <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" /> | |
| 7 | |
| 8 <% | |
| 9 | |
| 10 String term = request.getParameter("term"); | |
| 11 | |
| 12 List<String> list = sessionBean.getFullTextSearchPage().suggestLevel1(term, 10); | |
| 13 | |
| 14 JSONArray jsonArr = new JSONArray(); | |
| 15 | |
| 16 for(String item : list){ | |
| 17 JSONObject json = new JSONObject(); | |
| 18 json.put("name", item); | |
| 19 json.put("value", item); | |
| 20 jsonArr.put(json); | |
| 21 System.out.print("*"); | |
| 22 } | |
| 23 out.println(jsonArr); | |
| 24 %> |
