comparison src/main/webapp/methods/level2Autocomplete.jsp @ 58:b8ad346e39a0

new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 02 May 2016 12:03:30 +0200
parents
children
comparison
equal deleted inserted replaced
57:5cbe567a9c52 58:b8ad346e39a0
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 String term = request.getParameter("term");
12 List<String> list = sessionBean.getSearchPage().suggestLevel2(term, 10);
13
14
15 JSONArray jsonArr = new JSONArray();
16
17 for(String item : list){
18 JSONObject json = new JSONObject();
19 json.put("name", item);
20 json.put("value", item);
21 jsonArr.put(json);
22 System.out.print("*");
23 }
24 out.println(jsonArr);
25 %>