我已经实现了从jquiry将json格式的数据传给struts的action,action将数据进行处理后需要返回数据给该jquiry,我在action中已经将数据组装成了json格式的,现在不知道在action中如何将数据传到jquiry中?请求大神指导啊?

解决方案 »

  1.   

    是jquery吧?
    用ServletActionContext.getResponse().getWriter().print(result); 网上找到的方法,自己再搜一下吧```
      

  2.   

    public class ResponseOperate {

    /**
     * 将jsonString输出
     */
    public static void responseOut(HttpServletResponse response,String jsonString)throws Exception
    {
        PrintWriter out=null;
        response.setCharacterEncoding("UTF-8");
                out=response.getWriter();
        out.write(jsonString);
        out.flush();
    }
    }