diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/webapp/methods/dynastyAutocomplete.jsp	Thu Apr 23 15:46:01 2015 +0200
@@ -0,0 +1,27 @@
+<%@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);
+%>
\ No newline at end of file