@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String name = req.getParameter("name"); String address = req.getParameter("address"); StringBuffer sb = new StringBuffer(""); sb.append("{\"name\":\"") .append(name) .append("_czz\",\"address\":\"") .append(address) .append("_czz\"}"); resp.setContentType("html/JSON;charset=utf-8"); resp.getWriter().print(sb.toString()); }
function alertHtml(e){ alert(e.html()); }