added jsonp to suggest servlet

pull/10/head
Michael Peter Christen 9 years ago
parent 0e87a99ab8
commit 785781253e

@ -102,6 +102,16 @@ public class suggest {
prop.putHTML("query", originalquerystring); prop.putHTML("query", originalquerystring);
} }
// check for JSONP
if ( post.containsKey("callback") ) {
final String jsonp = post.get("callback") + "([";
prop.put("jsonp-start", jsonp);
prop.put("jsonp-end", "])");
} else {
prop.put("jsonp-start", "");
prop.put("jsonp-end", "");
}
// Adding CORS Access header for xml output // Adding CORS Access header for xml output
if (xml) { if (xml) {
final ResponseHeader outgoingHeader = new ResponseHeader(200); final ResponseHeader outgoingHeader = new ResponseHeader(200);

@ -1 +1 @@
["#[query]#",[#{suggestions}#"#[text]#"#(eol)#,::#(/eol)##{/suggestions}#]] #[jsonp-start]#["#[query]#",[#{suggestions}#"#[text]#"#(eol)#,::#(/eol)##{/suggestions}#]]#[jsonp-end]#
Loading…
Cancel
Save