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

java登录由JS 生成的页面,该怎么处理

2013-11-13 
java登录由JS 生成的页面html源代码title/titlestylebody {MARGIN: 0 0 0 0background-color: #e1e

java登录由JS 生成的页面
html源代码


<title></title>
<style>
body {
    MARGIN: 0 0 0 0;
    background-color: #e1e9f4;
}
</style>
<META content="MSHTML 6.00.2800.1625" name=GENERATOR>
</head>

<body onload="init()" topmargin="0" leftmargin="0" bgcolor="#e1e9f4"> 
<form name="login" action="redirct_index.htm" method="post" onsubmit="return formSubmit2(this);">
<input type=hidden name=rtime>
<SCRIPT language=javascript> 
dis_login(); 
</SCRIPT> 
</form>
</body>
<SCRIPT language=JavaScript>



</SCRIPT>

</html>

HTML中就一个JS,JS中绘制登录框,JS源码


function dis_login() 
{
    document.write("<table width=100% height=90% border=0><tr><td align=center style='font-family: verdana,arial,sans-serif; font-size: 12px ;COLOR: #333333'><DIV class=da_width >"+ 
    "<DIV style='BACKGROUND: url(images/back.jpg); HEIGHT: 214px' id=dl_margin>"+ 
    "<DIV style='font-size: 14px; WIDTH: 280px; MARGIN-TOP: 0px; PADDING-TOP: 25px' align=center><b>"+productInfo+"</b></DIV>"+
    "<DIV style='MARGIN-TOP: 43px; FLOAT: left; WIDTH: 250px' align=right><IMG src='images/h3c_logo.jpg'>&nbsp;</DIV>"+ 
    "<DIV style='HEIGHT: 20px;WIDTH: 480px'></DIV>"+
    "<DIV align=left>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用户名 <INPUT TabIndex=1 style='BORDER-RIGHT: #87a6c3 1px solid; BORDER-TOP: #87a6c3 1px solid; BACKGROUND: #edeced; BORDER-LEFT: #87a6c3 1px solid; WIDTH: 115px; BORDER-BOTTOM: #87a6c3 1px solid; HEIGHT: 19px' "+
    "id='userName' name='userName' size='16' maxlength='32' onkeypress="move(event,'password');if(event.keyCode=='13'){return false;}"></DIV>");
    if (0 == vldcode_en)
    {
        document.write('<DIV>&nbsp;</DIV>');
    }
    document.write("<DIV align=left>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;密 码 ");
    if (1 == vldcode_en)
    {
        document.write('<input TabIndex=2 id="password" name="password" size="16" maxlength="32" type="password" onkeypress="move(event,\'vldcode\');if(event.keyCode==13){return false;}" ');
    }
    else
    {
        document.write('<input TabIndex=2 id="password" name="password" size="16" maxlength="32" type="password" onkeypress="onEnterSub(event)" ');
    }
    document.write("style='BORDER-RIGHT: #87a6c3 1px solid; BORDER-TOP: #87a6c3 1px solid; BACKGROUND: #edeced; BORDER-LEFT: #87a6c3 1px solid; WIDTH: 115px; BORDER-BOTTOM: #87a6c3 1px solid; HEIGHT: 19px'>");
     
    document.write('<a href=javascript:void(0) onclick=popUserFaq("user_faq.htm?#_Toc286769551")> 忘记密码</a></DIV>');
      
    if (1 == vldcode_en)
    {
        document.write("<DIV align=left>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;验证码 <INPUT TabIndex=3 style='BORDER-RIGHT: #87a6c3 1px solid; BORDER-TOP: #87a6c3 1px solid; BACKGROUND: #edeced; BORDER-LEFT: #87a6c3 1px solid; WIDTH: 115px; BORDER-BOTTOM: #87a6c3 1px solid; HEIGHT: 19px'"); 
        document.write('id="vldcode" name="vldcode" size="16" maxlength="4" type="text" onkeypress="onEnterSub(event)" >');
        document.write('<img id=vldimp src="images/vld.bmp" alt="java登录由JS 生成的页面,该怎么处理" onclick=get_vldbmp() style="cursor:pointer"/></DIV>');
    }
    document.write("<span name='messages' id=messages style='HEIGHT:3px; MARGIN-TOP: 0px; MARGIN-LEFT: 20px; WIDTH: 200px; PADDING-TOP: 8px; FLOAT: left;'></span>"+ 
    "<br><br>");
    if (1 == vldcode_en)
    {
        document.write("<DIV style='WIDTH: 80px; MARGIN-TOP: 0px; PADDING-TOP: 12px;'><input TabIndex=4 type='submit' value='  登录  '></DIV>");


    }
    else
    {
        document.write("<DIV style='WIDTH: 80px; MARGIN-TOP: 0px; PADDING-TOP: 20px;'><input TabIndex=3 type='submit' value='  登录  '></DIV>");
    }
     
    document.write("<DIV align=center>&nbsp;</DIV>"+
    "<DIV align=center>推荐分辨率1024*768</DIV>"+
    "<DIV class=lclear></DIV>"+
    "</DIV></DIV></td></tr></table>"); 
}

</SCRIPT> 



怎么用java代码登录啦? 有没有什么现成的框架可以使用 或者框架与JS交互的。
[解决办法]
那就等页面生成之后,请求带上参数redirct_index.htm action
[解决办法]
不管它生成不生成html,最终登陆的是这个form
<form name="login" action="redirct_index.htm" method="post" onsubmit="return formSubmit2(this);">
所以你最终的请求就是这个action。哦,还有可能是这个formSubmit2(this);区去分析下这个formSubmit2
[解决办法]
代码写得好邪恶!!!
[解决办法]
和正常登录一样吧。你浏览器调试工具应该可以看到生成的代码。源文件没有。
[解决办法]
js只是生成了form内的用户名、密码等的输入框,这个没有说框架和js交互,什么框架都可以
[解决办法]
引用:
Quote: 引用:

不管它生成不生成html,最终登陆的是这个form
<form name="login" action="redirct_index.htm" method="post" onsubmit="return formSubmit2(this);">
所以你最终的请求就是这个action。哦,还有可能是这个formSubmit2(this);区去分析下这个formSubmit2


版主帮忙看看上面的代码,是这样跟参数么?

好像还有个验证码,这个比较麻烦。需要识别验证码的。。。
[解决办法]
你那个页面在哪?
String surl = "http://192.168.0.234/.../redirct_index.htm"
[解决办法]
String surl = "http://192.168.0.234/redirct_index.htm" 
用这个事实
引用:
Quote: 引用:

你那个页面在哪?
String surl = "http://192.168.0.234/.../redirct_index.htm"


页面 就是这个,“http://192.168.0.234”

登录进去就可以看到里面的菜单页面了。

热点排行
Bad Request.