日期:2014-05-20  浏览次数:20759 次

麻烦高手帮忙进来看一下啊! 小弟遇到一个AjaxAnyWhere 与Struts整合的问题
公司项目用到了AjaxAnyWhere   和Struts  
现在碰到这么一个问题..在Struts里面向客户端返回数据
我重写了aa.js里面的callback   回调函数....
但用responseText   接收返回信息时总是为空!   这是什么原因啊!

struts   :
      public   class   ListAction   extends   Action   {

public   ActionForward   execute(ActionMapping   actionMapping,   ActionForm   actionForm,   HttpServletRequest   request,   HttpServletResponse   response)   throws   Exception   {

PrintWriter   out=null;  

        out=response.getWriter();
       
        if(AAUtils.isAjaxRequest(request)){          
                          AAUtils.addZonesToRefresh(request,   "list ");
                  }
       
                System.out.println( "name: "+request.getParameter( "name "));
                System.out.println "address: "+request.getParameter "address "));                
             
                out.print( "yumensile ");
                out.close();
           
     
return   null;
}
}


aa.js

    AjaxAnywhere.prototype.callback   =   function()   {

        if   (this.req.readyState   ==   4)   {
                this.callbackExecuted   =   true;

                this.onBeforeResponseProcessing();
                this.hideLoadingMessage();

                if   (this.req.status   ==   200)   {

                        if   (this.req.getResponseHeader( 'content-type ').toLowerCase().substring(0,   8)   !=   'text/xml ')   {
                                this.handleWrongContentType();
                                return;
                        }
                        alert(this.req.responseText);
}
}
}



------解决方案--------------------
关注,帮顶,我之前也没有成功。。。
------解决方案--------------------
up
------解决方案--------------------
顶1