comparison src/main/webapp/methods/taskPeriodAutocomplete.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
12 String term = request.getParameter("term");
13
14 List<String> list = sessionBean.getHomePage().suggestPeriod(term, 10);
15
16 JSONArray jsonArr = new JSONArray();
17
18 for(String item : list){
19 JSONObject json = new JSONObject();
20 json.put("name", item);
21 json.put("value", item);
22 jsonArr.put(json);
23 System.out.print("*");
24 }
25 out.println(jsonArr);
26 %>