Copy code code as follows:
Public Actionforward Xsearch (actionmapping mapping, actionform form,
Ht Tpservletrequest request, HttpServletResponse response)
throws Exception {
String parentid = request.getparame ter ("ParentID");
String supplier = request.getparameter ("supplier");
List itemList = new ArrayList ();
if (Parentid.equals (")) {
parentid=" 0 ";
}
Map map=new tawaptreeservlet (). Gettypelist (ParentID, supplier);
for (iterator Rowit = Map.keyset (). iterator (); Rowit.hasnext ();) {
String id = (string) rowit.next ();
Tawcommonsuilistitem UIItem = new Tawcommonsuilistitem ();
Uiitem.setitemid (ID);
Uiitem.settext ((String) map.get (id));
Uiitem.setvalue (ID);
Itemlist.add (UIItem);
}
Response.setcontenttype ("Text/xml;charset=utf-8");
//Returns the JSON object
Response.getwriter (). Print (Jsonutil.list2json (itemList));
return null;
}