【发布时间】:2013-11-20 06:39:24
【问题描述】:
我想在几秒钟后从一个 jsp 重定向到另一个 jsp。我有以下代码:
<body style="height: 302px; color: Olive">
<h2> Result of your transaction </h2>
<hr style="height: 5px; ">
<p align="center">
<h3> ${result}</h3>
<br>
<hr>
<form id="clientCall" method="post" action="http://localhost:8080/SpringMVCClient/transactionResultMovieTheater.htm?">
<input type="hidden" name="userId" id="userId" value="${userId}"/>
</form>
<script type="text/javascript">
document.setTimeout("alert ('Now you will be redirected to the main Site');",3000);
document.getElementById("clientCall").submit();
</script>
</body>
但是什么都没有发生。它只是打印出 ${result},然后停留在同一页面上。我写错代码了吗?请在这里指导我。
提前致谢!
【问题讨论】:
标签: html jsp timeout response.redirect