Copy codeThe Code is as follows:
Public ActionForward xsearch (ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
Throws Exception {
String parentId = request. getParameter ("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 ");
// Return a JSON object
Response. getWriter (). print (JSONUtil. list2JSON (itemList ));
Return null;
}