为什么我点击按钮后就到空白页了
当前页面“http://localhost:8080/hd/index.jsp”
点击后页面为“http://localhost:8080/hd/hdmain.do?method=toAdd”
index 页面代码
<script type="text/javascript">
function toAdd(){
window.alert("toAdd");
document.forms[0].action+="?method=toAdd";
document.forms[0].submit();
}
</script>
按钮的<input type="button" value="添加" onclick="javascript:toAdd();">
add 页面
里面有内容
当点击了 添加按钮后 弹出 “toadd” 说明进入了 toAdd这个funtion
但是 页面就一直停留在 http://localhost:8080/hd/hdmain.do?method=toAdd 不动了
action 方法 没有进入 syso 在控制台上没有显示toADD
public ActionForward toAdd(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
//给页面TOADD添加页面跳转
System.out.println("toADD");
List list = iHmainBiz.findHdmainDao();
request.setAttribute("list", list);
return mapping.findForward("add");
}
麻烦各位老大 是什么原因哈?