Mercurial > hg > LGServices
diff src/main/webapp/methods/fullTextSearchBookNameAutocomplete.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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/webapp/methods/fullTextSearchBookNameAutocomplete.jsp Mon May 09 16:02:32 2016 +0200 @@ -0,0 +1,24 @@ +<%@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.getFullTextSearchPage().suggestBookName(term, 10); + + 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); +%> \ No newline at end of file