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

httpclient自动登录的有关问题

2014-01-15 
httpclient自动登录的问题本帖最后由 beijinuo 于 2014-01-09 23:01:30 编辑在使用httpclient做自动登录的

httpclient自动登录的问题
本帖最后由 beijinuo 于 2014-01-09 23:01:30 编辑 在使用httpclient做自动登录的时候,登录成功,但是跳转之后的页面里面的body没有内容.只能一个空荡荡的<div></div>.
   我在想造成这个原因是不是因为对方的系统是用ext写的,而httpclient无法解析js,最终导致只是获得那个框架的index.jsp的代码,而无法对其他页面进行加载。
因为刚刚接触httpclient这一块,无法找到确切的解决方法,希望各位码友能够帮忙解答下。如何才能正常的获得登录之后的页面。以下就是我用httpclient自动登录后获得的代码,body中没有任何东西,该如何解决呢?

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"><link href="../Scripts/ext-3.3.1/resources/css/ext-all.css" rel="stylesheet" type="text/css" /><link href="../Scripts/ext-ux3.3.1/css/ux-all.css" rel="stylesheet" type="text/css" /><link href="../Content/Site.css" rel="stylesheet" type="text/css" /><link href="../Content/IconCls.css" rel="stylesheet" type="text/css" /><link href="../Scripts/ext-ux3.3.1/SuperBoxSelect/superboxselect.css" rel="stylesheet" type="text/css" /><link href="../Scripts/ext-ux3.3.1/GridSummary/GridSummary.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/ext-3.3.1/adapter/ext/ext-base.js" type="text/javascript"></script>
    <script src="../../Scripts/ext-3.3.1/ext-all.js" type="text/javascript"></script>
    <script src="../../Scripts/ext-3.3.1/ext-lang-zh_CN.js" type="text/javascript"></script>
    <script src="../../Scripts/RemoteValidator.js" type="text/javascript"></script>
    <script src="../../Scripts/ext-ux3.3.1/ux-all.js" type="text/javascript"></script>
    <script src="../../Scripts/RowEditorOverride.js" type="text/javascript"></script>
    <script src="../../Scripts/FilterOverride.js" type="text/javascript"></script>
    <script src="../../Scripts/Ext.data.StoreOverride.js" type="text/javascript"></script>
    <script src="../../Scripts/ComboBoxOverride.js" type="text/javascript"></script>
    <script src="../../Scripts/ext-ux3.3.1/SuperBoxSelect/SuperBoxSelect.js" type="text/javascript"></script>
<script src="../../Scripts/ext-ux3.3.1/GridSummary/GridSummary.js" type="text/javascript"></script>
    <script src="../../Scripts/Ext.form.Action.LoadOverride.js" type="text/javascript"></script>
    <script src="../../Scripts/ext-3.3.1/ext-ui-slider-pagesize.js" type="text/javascript"></script>
    <script src="../../Scripts/ext-3.3.1/ext-ui-combo-pagesize.js" type="text/javascript"></script>
    <script src="../../Scripts/JsHelper.js" type="text/javascript"></script>
    <script src="../../Scripts/CustomExt.js" type="text/javascript"></script>

<script src="../../Scripts/Main/UpdatePassword.aspx.js" type="text/javascript"></script>
    <script src="../../Scripts/Main/MasterPage.aspx.js" type="text/javascript"></script>
    <script src="../../Scripts/LodopFuncs.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript"> 
        var goodexit = false;
        function bindunbeforunload() {
            goodexit = false;
            window.onbeforeunload = perforresult;
        }
        function unbindunbeforunload() {
            goodexit = true;
            window.onbeforeunload = null;
        }
        function perforresult() {
            if (!goodexit) {
 
                Ext.Ajax.request({ url: '/Main/Logout', success: function (response, opts) {           
                            var result = Ext.util.JSON.decode(response.responseText); 
                            if (result.success) {  }
                            else {  } 


                    }
                  }); 
                return "是否确定要离开本系统?";
            }
            else {
                return alert('2');
            }
        } 
</script> 
    <title>
</title></head>
<body>
   <div></div>
</body>
</html>


[解决办法]
貌似他们的页面时懒加载的,返回给客户端的是一堆脚本,需要的时候才调用ajax显示出内容来

热点排行