读书人

httpclient自动登录的有关问题

发布时间: 2014-01-15 15:40:23 作者: rapoo

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 style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/ext-3.3.1/adapter/ext/ext-base.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/ext-3.3.1/ext-all.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/ext-3.3.1/ext-lang-zh_CN.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/RemoteValidator.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/ext-ux3.3.1/ux-all.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/RowEditorOverride.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/FilterOverride.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/Ext.data.StoreOverride.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/ComboBoxOverride.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/ext-ux3.3.1/SuperBoxSelect/SuperBoxSelect.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/ext-ux3.3.1/GridSummary/GridSummary.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/Ext.form.Action.LoadOverride.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/ext-3.3.1/ext-ui-slider-pagesize.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/ext-3.3.1/ext-ui-combo-pagesize.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/JsHelper.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/CustomExt.js" type="text/javascript"></script>

<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/Main/UpdatePassword.aspx.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/Scripts/Main/MasterPage.aspx.js" type="text/javascript"></script>
<script style="max-width: 100%;height: auto;width: auto\9;" src="http://www.reader8.com/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显示出内容来

读书人网 >J2EE开发

热点推荐