Mercurial > hg > LGServices
view src/main/webapp/methods/dynastyAutocomplete.jsp @ 33:5520f941f6cb
new: sorting and filters in homepage for branch list
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 25 Sep 2015 14:32:47 +0200 |
parents | c30ff4f27ec3 |
children |
line wrap: on
line source
<%@page import="java.util.List"%> <%@page import="de.mpiwg.gazetteer.utils.DBService"%> <%@page import="org.json.JSONObject"%> <%@page import="org.json.JSONArray"%> <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" /> <% String term = request.getParameter("term"); List<String> list = sessionBean.getSearchPage().suggestDynasty(term, 10); System.out.println("dynastyFilter: " + term + " " + list.size()); JSONArray jsonArr = new JSONArray(); for(String item : list){ JSONObject json = new JSONObject(); json.put("name", item); json.put("value", item); jsonArr.put(json); System.out.print("*"); } out.println(jsonArr); %>