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>