现在又一个项目在使用中碰到的奇怪问题,非必显。
例如:
我删除一条数据
url:http://localhost:8080/Fas/jsp/cacheServlet 方法ID 34  数据guid a61c9271ceabcef85d03f0369e82eb1a56d43fe3 
以下两处:
httpwatch抓的数据:
<entry method="POST" URL="http://localhost:8080/Fas/jsp/cacheServlet">
<pageref idref="page_6678" />
<started>71:29:37.907</started>
<startedDateTime>2013-04-01T15:44:51.125</startedDateTime>
<time>0.115</time>
<sent>692</sent>
<received>3643</received> <result>200</result>
<overview>
<action name="Submit Form" status="Completed">Browser submitted values to http://localhost:8080/Fas/jsp/cacheServlet</action>
<action name="Started At" status="Completed">2013-Apr-01 15:44:51.125 (local time)</action>
<action name="Connection Reuse" status="Completed">An existing connection 127.0.0.1:2151 was reused</action>
<action name="HTTP Request" status="Completed">Unconditional request sent for http://localhost:8080/Fas/jsp/cacheServlet</action>
<action name="HTTP Response" status="Completed">Headers and content returned</action>
</overview>
<request>
<requestMethod>POST /Fas/jsp/cacheServlet HTTP/1.1</requestMethod>
<cookies>
<cookie name="JSESSIONID" path="/Fas/" domain=".localhost">57B03C638BB71BF29D6C871E26A2EC61</cookie>
<cookie name="nasusercookie" path="/Fas/" domain=".localhost" expires="Fri, 05-Apr-2013 06:45:52 GMT">admin</cookie>
</cookies>
<headers>
<header name="Accept">image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*</header>
<header name="Accept-Encoding">gzip, deflate</header>
<header name="Accept-Language">zh-cn</header>
<header name="Cache-Control">no-cache</header>
<header name="Connection">Keep-Alive</header>
<header name="Content-Length">82</header>
<header name="Content-Type">application/x-www-form-urlencoded</header>
<header name="Cookie">nasusercookie=admin; JSESSIONID=57B03C638BB71BF29D6C871E26A2EC61</header>
<header name="Host">localhost:8080</header>
<header name="Referer">http://localhost:8080/Fas/jsp/cacheServlet</header>
<header name="User-Agent">Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.2; .NET CLR 2.0.50727)</header>
</headers>
<postData mimeType="application/x-www-form-urlencoded">
<parameter name="guids">a61c9271ceabcef85d03f0369e82eb1a56d43fe3</parameter>
<parameter name="method">34</parameter>
<parameter name="nasrequesttype">formsubmit</parameter>
</postData>
</request>
<response>
<responseStatus>HTTP/1.1 200 OK</responseStatus>
<cookies></cookies>
<headers>
<header name="Cache-Control">no-cache</header>
<header name="Content-Length">3416</header>
<header name="Content-Type">text/html;charset=UTF-8</header>
<header name="Date">Mon, 01 Apr 2013 07:44:51 GMT</header>
<header name="Expires">Thu, 01 Jan 1970 00:00:00 GMT</header>
<header name="Pragma">No-cache</header>
<header name="Server">Apache-Coyote/1.1</header>
</headers>
<content>
<contentLength>3416</contentLength>
<text><![CDATA[
....<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">..<html>..<head>..<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">....<script type="text/javascript" src="/Fas/common/js/jquery.js"></script>..<script type="text/javascript" src="/Fas/common/js/main.js"></script>..<script type="text/javascript" src="/Fas/common/js/common.js"></script>..<script type="text/javascript" src="/Fas/common/js/jquery-ui.js"></script>....<link rel="stylesheet" type="text/css" href="/Fas/common/css/jquery-ui.css" />..<link rel="stylesheet" type="text/css" href="/Fas/common/css/style.css" />....<script type="text/javascript">...function toAddRwCache(){....var rwCacheForm = createForm('rwCache');....setHiddenToForm(rwCacheForm,"method","29");....rwCacheForm.action = "/Fas/jsp/cacheServlet";....rwCacheForm.submit();...}.....function viewDetail(guid){....var rwCacheForm = createForm('rwCache');....setHiddenToForm(rwCacheForm,"method","31");....setHiddenToForm(rwCacheForm,"guid",guid);....rwCacheForm.action = "/Fas/jsp/cacheServlet";....rwCacheForm.submit();...}.....function editRwCache(guid){....var rwCacheForm = createForm('rwCache');....setHiddenToForm(rwCacheForm,"method","32");....setHiddenToForm(rwCacheForm,"guid",guid);....rwCacheForm.action = "/Fas/jsp/cacheServlet";....rwCacheForm.submit();...}.....function doDelOneRwCache(guid, bind_hdd){....if(bind_hdd >= 1) {.....alert("读写缓存已绑定了设备,请先解除绑定");.....return;....}....if(!window.confirm("确定删除吗?")){.....return;....}........var rwCacheForm = createForm('rwCache');....setHiddenToForm(rwCacheForm,"method","34");....setHiddenToForm(rwCacheForm,"guids",guid);....rwCacheForm.action = "/Fas/jsp/cacheServlet";....rwCacheForm.submit();...}......function doDelRwCache(){....var selecteditem = getElementCheched("chkbox");....if (selecteditem.length == 0) {.....alert("请选择数据!");.....return;....}....if (!window.confirm("确定删除吗?")) {.....return;....}....var rwCacheForm = createForm('rwCache');....setHiddenToForm(rwCacheForm,"method","34");....for(var i=0; i<selecteditem.length; i++) {.....setHiddenToForm(rwCacheForm,"guids",selecteditem[i]);....}....rwCacheForm.action = "/Fas/jsp/cacheServlet";....rwCacheForm.submit();...}....</script>..</head>..<body onload="alertError('');">...<div class="rightTitle" id="rightReadCache">....<span id="parentTxt"></span>&nbsp;&gt;&nbsp;<span id="childTxt"></span>...</div>...<div id="tabs">....<ul>.....<li><a href="#tab0">读写缓存信息</a></li>.....<li class="lastChild">......<div id="msg_alert"></div>.....</li>....</ul>....<div id="tab0">.... ...<table id="mytable" cellspacing="0">....<tr>.....<th><input type="checkbox" name="box" onclick="selectCheckbox(this)" style="cursor: pointer;"/></th>.....<th>读写缓存名称</th>.....<th>固态硬盘数量</th>.....<th>总容量(GB)</th>.....<th>条带大小(KB)</th>.....<th>状态</th>.....<th></th>....</tr>.........<tr><td colspan="7"><div class="msg">没有读写缓存信息</div></td></tr>...................</table>......<div style="height: 30px;"></div>...<div id="sheet">.........<input type="button" value=" 添 加" onclick="toAddRwCache()"/>.........&nbsp;.......</div>..</div>...</div>..</body>..<script type="text/javascript">...title("固态加速管理", "读写缓存管理");...$("#tabs").tabs();..</script>..</html>
]]></text>
1.这里可以看到TOMCAT是返回HTML数据。[/color]
<mimeType>text/html;charset=UTF-8</mimeType>
</content>
</response>
<cache>
<beforeRequest>
<URLInCache>false</URLInCache>
</beforeRequest>
<afterRequest>
<URLInCache>false</URLInCache>
</afterRequest>
</cache>
<timings>
<blocked started="0.000">0.002</blocked>
<send started="0.002">0.000</send>
<wait started="0.002">0.112</wait>
<receive started="0.114">0.001</receive>
<ttfb started="0.002">0.112</ttfb>
<network started="0.002">0.113</network>
</timings>
</entry>
[color=#FF0000]2.正常的情况下以下是HTML中 css 和 js的数据请求

<entry method="GET" URL="http://localhost:8080/Fas/common/js/jquery.js">
<pageref idref="page_6679" />
<started>00:00:01.566</started>
<startedDateTime>2013-04-01T17:59:53.722</startedDateTime>
<time>0.001</time>
<sent>0</sent>
<received>0</received> <result>(Cache)</result>
<overview>
<action name="Display URL" status="Completed">Normal browser lookup of URL http://localhost:8080/Fas/common/js/jquery.js</action>
<action name="Started At" status="Completed">2013-Apr-01 17:59:53.722 (local time)</action>
<action name="Read Cache" status="Completed">Content read from browser cache</action>
</overview>
<request>
<requestMethod></requestMethod>
<cookies></cookies>
<headers></headers>
</request>
<response>
<responseStatus></responseStatus>
<cookies></cookies>
<headers></headers>
<content>
<contentLength>93868</contentLength>
<mimeType>text/javascript;charset=UTF-8</mimeType>
</content>
</response>
<cache>
<beforeRequest>
<URLInCache>true</URLInCache>
<lastModification>2012-11-06T02:39:32</lastModification>
<lastCacheUpdate>2013-04-01T09:29:52</lastCacheUpdate>
<lastAccess>2013-04-01T09:59:10.078</lastAccess>
<eTag>W/&quot;93868-1352169572265&quot;</eTag>
<hitCount>143</hitCount>
</beforeRequest>
<afterRequest>
<URLInCache>true</URLInCache>
<lastModification>2012-11-06T02:39:32</lastModification>
<lastCacheUpdate>2013-04-01T09:29:52</lastCacheUpdate>
<lastAccess>2013-04-01T09:59:53.765</lastAccess>
<eTag>W/&quot;93868-1352169572265&quot;</eTag>
<hitCount>146</hitCount>
</afterRequest>
</cache>
<timings>
<cache_read started="0.000">0.001</cache_read>
</timings>
</entry>
...
现在的问题是这些CSS js 的url数据根本没有,就好像IE浏览器获取到了html但是没有处理这个html不知道那位大大知道这个是什么原因造成的呢?

解决方案 »

  1.   

    可能问题说得不够明白
    就是IE接受到HTML没有解析HTML!
      

  2.   

    是不是 直接显示的html标签 ???我以前也老是遇到过,,你试试 指定response.setContentType("charset=UTF-8;text/html");应该是这样子吧  我也不记得了。。
      

  3.   

    不是的哦!就是页面没有处理相应!我每个请求之前都会弹出一个旋转的GIF。当获取到数据的时候,显示获取到的页面。
    现在就是gif一直都在 后台获取到页面 没有显示出来,我利用httpwatch抓到的包,显示已经获取到完整的html了,但是浏览器没有替换当前的页面。
    对了,我后台还有一个定时器,刷新警告日志。我觉得是否因为这个定时器覆盖了我之前的请求!
      

  4.   

    建议使用ajax 异步处理  当去后台获取数据的时候gif就一直显示 当从后台拿到数据 就把gif去掉 然后动态生成数据列表
      

  5.   

    我现在发现 并不是 定时器ajax请求覆盖了前台的表单提交请求!
     
      

  6.   

    我现在的所有表单提交 都是通过 js 创建表单然后提交的!
    js代码:
    function createForm(id) {
    return createF(id, true);
    }
    function createF(id, waitingNeeded){
    if(waitingNeeded){
    createWaiting();
    }
    resetTimer();
    var myForm = document.getElementById(id);
    if (myForm != null) {
    document.body.removeChild(myForm);
    }
    myForm = document.createElement('form');
    document.documentElement.appendChild(myForm);
    setHiddenToForm(myForm,"nasrequesttype", "formsubmit");
    myForm.name = id;
    myForm.id = id;
    myForm.method = 'POST';
    myForm.enctype = 'application/x-www-form-urlencoded';
    myForm.encoding = 'application/x-www-form-urlencoded';
    myForm.target = '_self';
    return myForm;
    }调用
    html :<input type="button" value=" 添加 " onclick="toAddWrite()"/>
    js:
    function toAddWrite(){
    var writeForm = createForm('write');
    setHiddenToForm(writeForm,"method","3");
    writeForm.action = "/Fas/jsp/cacheServlet";
    writeForm.submit(); 
    }定时器代码:
    function checkNewLog(){
    $.ajax({
    type : "POST",
    url : "<%=request.getContextPath()%>/jsp/systemServlet",
    data : "method=8",
    cache : false,
    timeout : 5000,
    success : function(msg) {
         alert(系统出错,错误原因:);
    },
    error : function(msg) {
    setTimeout(checkNewLog, 40000);//四十秒检查一次

    }
    });
    }系统结构:
    主框架中调用了一个 iframe="main"显示所有获取到的信息,main框架左边是菜单栏 上面是
    标题栏 ,下面则是版权信息。
    检查日志的定时器登录进来就开启了,其他提交表单等请求都在
    main框架中。