1、onload属性
跳转到servlet,地址是:http://lenovo:8080/wx_kaoyan/servlet/MainAction
<body onload="window.location='./servlet/MainAction'"> </body>
2、jsp:forward
跳转到servlet,地址是:http://lenovo:8080/wx_kaoyan
<jsp:forward page="./servlet/MainAction" />
Done!
1、onload属性
跳转到servlet,地址是:http://lenovo:8080/wx_kaoyan/servlet/MainAction
<body onload="window.location='./servlet/MainAction'"> </body>
2、jsp:forward
跳转到servlet,地址是:http://lenovo:8080/wx_kaoyan
<jsp:forward page="./servlet/MainAction" />
Done!
转载于:https://www.cnblogs.com/xingyyy/p/3639040.html