解决方案 »

  1.   

    ajax也就和struts2有点关系,和hibernate、spring扯不上什么事。
    关键点无非就是struts2处理ajax请求,并通过json插件返回json数据。
    但是不推荐struts的json插件,推荐使用这种方法:在Action中retrun null,然后通过response.getWriter().wirite(str)的方式输出ajax响应的响应文本。
      

  2.   

    你整合出什么问题了,我觉得Ajax最多用一个jQuery的js文件
      

  3.   

    你需要jar 做什么?是因为jar 的原因吗?出什么错误最好贴出来看看。
      

  4.   

    这些框架使用手册都已经描述了和对应的框架整合的例子,里面肯定也有需要用到的jar。
      

  5.   

    为什么$(document).ready(function(){
    $("#b1").click(function(){
    $.getJSON("testAction_getMsg.action",function(data){
    alert(data.msg);
    $("#message").show().html(data.msg);
    })


    });
    });
    这里出来的信息是我action中的返回值不是msg,
    public String getMsg() throws Exception {
    msg="hello World";
    System.out.println("===================");
    ServletActionContext.getResponse().getWriter().write(msg);

    return "returnJSON";
    }
    alert出来的是returnJSON,而不是hello World
      

  6.   

    加上ServletActionContext.getResponse().getWriter().close();