package com; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONArray; public class BaiduServlet extends HttpServlet { public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { String name = request.getParameter("name"); name=new String(name.getBytes("ISO-8859-1"),"utf-8"); BaiduSuggestionUtil baiduSuggestionUtil = new BaiduSuggestionUtil(); JSONArray jsonArray = baiduSuggestionUtil.getBaiduRelateWord(name); String result = jsonArray.toString(); response.setContentType("text/json;charset=UTF-8"); response.getWriter().write(result); } catch (Exception e) { e.printStackTrace(); } } }

chenkaizhen LV1
2021年11月26日
zhj7181 LV1
2021年7月4日
totcom LV1
2021年3月3日
邈话12123 LV9
2020年10月29日
duke最拽 LV3
2020年10月22日
能不能不存在 LV13
2020年5月11日
kangran LV1
2020年4月17日
wanminhang LV12
2020年3月15日
3030617253 LV2
2019年11月30日
时空12580 LV13
2019年1月6日