comparison src/main/webapp/methods/dynastyAutocomplete.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 c30ff4f27ec3
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 <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />
7
8 <%
9
10
11
12 String term = request.getParameter("term");
13 List<String> list = sessionBean.getSearchPage().suggestDynasty(term, 10);
14
15 System.out.println("dynastyFilter: " + term + " " + list.size());
16
17 JSONArray jsonArr = new JSONArray();
18
19 for(String item : list){
20 JSONObject json = new JSONObject();
21 json.put("name", item);
22 json.put("value", item);
23 jsonArr.put(json);
24 System.out.print("*");
25 }
26 out.println(jsonArr);
27 %>