首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

麻烦高手帮忙进来看一下啊! 小弟遇到一个AjaxAnyWhere 与Struts整合的有关问题

2011-12-24 
麻烦高手帮忙进来看一下啊! 小弟遇到一个AjaxAnyWhere 与Struts整合的问题公司项目用到了AjaxAnyWhere和St

麻烦高手帮忙进来看一下啊! 小弟遇到一个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

热点排行