我在其他流行的浏览器中没有这个问题。在JSP页面(让我们称之为Page1.jsp)中,我单击一个表单,它转到另一个页面。当我单击Opera的Back按钮时,它会返回到Page1.jsp,但是没有重新启动JavaScript或JSP代码。例如,
<!-- Inside header tag -->
<script language="JavaScript>
alert("Does this work in Opera?");
</script>
一个简单的警报语句不会触发。服务器端代码也是如此。然而,其他流行的桌面浏览器没有问题。
如果登录servlet中的用户名、密码和位置正确,我将创建一个HttpSession并转到jsp页面。以下是servlet中的代码:
HttpSession sessionsa = request.getSession(true);
sessionsa.setAttribute("user",userName); //userName is a String variable
sessionsa.setAttribute("location",location); //location in value place is a String