0

Web アプリケーション (JSF 1.2 + Ajax4jsf 1.1) に問題があります。次のエラーが発生します。

**Message: Permission denied
Line: 27
Char: 222
Code: 0
URI: http://uat.example.com/ABC/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript.jsf**

この問題は散発的で、50% の確率で発生します。この問題は、他のすべてのブラウザーの IE8 でのみ発生します。このエラーが発生すると、ページ全体が空白になります。ただし、更新するとページが元に戻ります。

IE QUIRK VS 標準モードに関する記事をいくつか読みました。 IE8 を強制的に IE7 互換モード にする 役に立ちませんでした。

注: これはクロス サイト スクリプティングの問題ではありません。これは、スクリプト (JSF によって生成される) がアプリがインストールされているドメインと同じドメインであるためです。

この問題を解決した人がいる場合はお知らせください。http://www.coderanch.com/t/490213/JSF/java/support-IEに投稿された同様の問題が見られ ます

4

1 に答える 1

1

問題の修正が見つかりました。 ajax4jsf-1.1.0.jar を変更して修正しました

根本原因: IE-8 の場合、応答はまだ読み取られていませんが、Ajax オブジェクトから応答がフェッチされています。そのため、status==200 と readystate=4 を確認して、IE の修正を追加しました。

jar 内の \org\ajax4jsf\framework\ajax\scripts\AJAX.js の下にある AJAX.js を開きます

STEP 1. から変更:

    getResponseText : function(){
       return this._request.responseText;
   }

に:

    getResponseText : function(){
    if (this._request.readyState == 4){
        if (this._request.status == 200) {
            return this._request.responseText;
        }
    }
}

ステップ 2. このメソッドを探して、FROM を変更します。

     window.setTimeout(function() {
    var isDocOpen=false;
    //This functions has few more lines , I have not pasted all code here...

への変更:

    //This is the Fix for IE....The isIE variable is pre defined inside the script.
    if (isIE){
 if (req.readyState == 4){
    if (req.status == 200) {
        window.document.open(req.getContentType(),true);
        isDocOpen=true;

        window.document.write(req.getResponseText());
        window.document.close();
    }
  }
    } 
    else {
    //This is the Original code...
    //Keep this for all other browsers...
    window.document.open(req.getContentType(),true);
     isDocOpen=true;
      window.document.write(req.getResponseText());
   window.document.close();
   }

....... コードの残りの部分は、元のスクリプトのとおりです。

ステップ 3:

    //COMMENT OUT THIS ORIGINAL CODE. Not sure why this reloading is done for IE
    //this was causing IE to send requests...more than once..   
    //if(isIE){
/ For Ie , scripts on page not activated.
//  window.location.reload(false);
//}

上記の変更を行った後、win rar を使用して Ajax.js ファイルを ajax4jsf-1.1.0.jar に戻し、IE 8 の問題が解決されました。

それが誰かを助けることを願っています。

于 2012-06-26T19:55:59.623 に答える