qq_矮油不绰_0
2018-04-17 21:38
如果servlet连接数据库,返回的是list类型的数组,jsp页面该怎样解析jsonArry并打印道下面提示框内
() { (.=== ) (.=== ) { =.responseText; = .(); (); } }
doGet(HttpServletRequest request, HttpServletResponse response) ServletException, IOException { request.setCharacterEncoding( ); response.setCharacterEncoding( ); String keyword=request.getParameter( ); ArticleService articleService=ArticleService(); UserService userService = UserService();JSONArray jsonArray = JSONArray(); List<Bbs_litleArt> listData1 = articleService.search_article( keyword ); (Bbs_litleArt bbs_litleArt:listData1) { JSONObject jsonObject = JSONObject( bbs_litleArt ); jsonArray.put( jsonObject ); } System..println(jsonArray); response.getWriter().write(String.(jsonArray)); }
Servlet+Ajax实现搜索框智能提示
37805 学习 · 146 问题
相似问题