我的fck上传图片,点击浏览服务器时,打开一个页面应该显示的是服务器的一些文件,但是我这里提示;
The server didn't send back a proper XML response
,可是我打印返回的值是正常的xml格式。
导致xml无法正常显示的原因是我的框架的问题,因为我把fck拿出来运行是正常的,放到我们框架里就提示上面的错误。
我们的框架也就是struts2,spring,hibernate,sitemesh等常见框架组合。我怀疑可能和spring的acegi有关,可是看了acegi的设置,没什么对xml进行过滤的。
麻烦问一下各位大哥有没有碰到这个问题,分析一下大概是哪里配置问题导致返回回来的xml文件流格式错误。

解决方案 »

  1.   

    格式正确,但contentType 可能不对吧。应该是 text/xml 
      

  2.   

    The server didn/t send back a proper XML response. Please contact your
    system administrator.XML request error:OK(200)
     Requested URL:
     http://localhost:8080/oa/fckeditor/editor/filemanager/connectors/php/connector.php?
     Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F&uuid=1241661246187
     
     Response test:
     <?xml version="1.0" encoding="UTF-8"?> <Connector command="GetFoldersAndFiles"
     resourceType="Image"><CurrentFolder path="/" url="/oa/userfiles/image/"/>
     <Folders/><Files><File name="1.PNG" size="33' /></Files></Connector>fck处理xml的代码如下:FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
    {
    var oFCKXml = this ; var bAsync = ( typeof(asyncFunctionPointer) == 'function' ) ; var oXmlHttp = this.GetHttpRequest() ; oXmlHttp.open( "GET", urlToCall, bAsync ) ; if ( bAsync )
    {
    oXmlHttp.onreadystatechange = function()
    {
    if ( oXmlHttp.readyState == 4 )
    {
    var oXml ;
    try
    {
    // this is the same test for an FF2 bug as in fckxml_gecko.js
    // but we've moved the responseXML assignment into the try{}
    // so we don't even have to check the return status codes.
    var test = oXmlHttp.responseXML.firstChild ;
    oXml = oXmlHttp.responseXML ;
    }
    catch ( e )
    {
    try
    {
    oXml = (new DOMParser()).parseFromString( oXmlHttp.responseText, 'text/xml' ) ;
    }
    catch ( e ) {}
    } if ( !oXml || !oXml.firstChild || oXml.firstChild.nodeName == 'parsererror' )
    {
    window.alert( 'The server didn\'t send back a proper XML response. Please contact your system administrator.\n\n' +
    'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')\n\n' +
    'Requested URL:\n' + urlToCall + '\n\n' +
    'Response text:\n' + oXmlHttp.responseText ) ;
    return ;
    } oFCKXml.DOMDocument = oXml ;
    asyncFunctionPointer( oFCKXml ) ;
    }
    }
    }
      

  3.   

    我不知道是不是你的笔误,但你的XML确实不合法:<?xml version="1.0" encoding="UTF-8"?> <Connector command="GetFoldersAndFiles"
    resourceType="Image"> <CurrentFolder path="/" url="/oa/userfiles/image/"/>
    <Folders/> <Files> <File name="1.PNG" size="33' /> </Files> </Connector> 因为红色部分引号不匹配。
    所以无法解析,导致报错。