日期:2014-05-17  浏览次数:20902 次

上午刚找大家解决自动登录下午又一个麻烦事,写个程序跟打小怪闯关是的~
谢谢大家帮我写好自动登录的~ 进到去我想实现自动提交~ 原想着跟登录一样简单  但是。。。。。。
<form id="" name="dn" action="/wlyxpb/pages/.do" method="post">
<table width="1000" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
.......(忽略)
<br>
<textarea name="dailyNewspaper.networkSafe" cols="100" rows="5" id="_dailyNewspaper_networkSafe" style="overflow:auto" onkeydown="checklength(this)" maxlength="500"></textarea>
<br>
<br>
</label>
</div>
</td>
</tr>
<tr bgcolor="#FFFFFF" class="end">
<td colspan="9">
<div align="center">
<input type="button" value="提交" onclick="return execute()" />
</div>
</td>
</tr>
</table>
</div>
<div align="center">
<br />
.......《忽略》


</head>

<body>


</form>




</body>
</html>

<script type="text/javascript">

function execute() {
var size = document.dn.al_wltiSize.value;
for(var i=0;i<size;i++){
var id01 = "_al_wlti_" + i +"__eventInfoA";
var value = document.getElementById(id01).value;
if(value == ""){
alert("请填写仪器故障说明。")
return false;
}
}

var isExist = document.getElementById("isExist").value;
if(isExist == "true"){
if (confirm('日报已提交,是否覆盖?')){
        document.dn.action='/wlyxpb/pages/DailyNewspaper/saveDNP_AC_watcher.do';
    document.dn.submit();
    return true;
     }
}else{
 document.dn.action='/wlyxpb/pages/DailyNewspaper/saveDNP_AC_watcher.do';
 document.dn.submit();
 return true;
}
}

</script>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~·
我写了
webBrowser1.Document.All["dn"].InvokeMember("submit");
它直接提交给wlyxpb/pages/.do
就出现一下这个网页
~~~~~~~~~~~~~~~~·
Struts Problem Report
Struts has detected an unhandled exception: 

Messages: com.company.project.action.Action 
Unable to instantiate Action, com.company.project.action.Action, defined for '' in namespace '/pages'com.company.project.action.Action 
 
File: org/apache/catalina/loader/WebappClassLoader.java 
Line number: 1,387 
~~~~~~~~~~~~~~~~~~~~~~~~~·
我觉得它应该提交给wlyxpb/pages/DailyNewspaper/saveDNP_AC_watcher.do 但不知道怎么写了!
webbrowser

------解决方案--------------------
webBrowser1.Document.All["dn"].SetAttribute("action","/wlyxpb/pages/DailyNewspaper/saveDNP_AC_watcher.do");
webBrowser1.Document.All["dn"].InvokeMember("submit");