是否有可能在 Tomcat 服务器上运行时一切正常,但当系统部署在互联网上时出现问题
我有这个系统,里面有一个注册表。提交后,如果用户按该页面上的后退按钮并返回注册页面时有一些验证未通过,则他输入的值仍会在该页面上,并且错误消息会以红色显示。这在 Tomcat 中工作得很好。
现在我有相同的代码并且它现在正在互联网上运行。当验证失败并转到有后退按钮的页面时,按下后退按钮时,所有值都会从注册页面消失,不会出现验证错误。这可能吗?可能发生了什么?
问候,
J Roq
PS:这是我认为出错的 JSP 代码,这是将使用后退按钮呈现页面的代码:
<c:if
test="${!empty sessionScope.RegistrationForm.problamticCode}">
<br><br></br><input type="button" value="BACK"
onclick="javascript:history.go(-1)" />
</c:if>
<c:if
test="${empty sessionScope.RegistrationForm.problamticCode}">
<%request.getSession().removeAttribute("registrationFormObject"); %>
</c:if>
I have this system where there is a registration form. Once submitted, if there is some validations that did not pass when the user presses the back button on that page and returns to the register page, the values he inputted will still be on that page along with error messages in red. This works fine in Tomcat.
Now I have the same code and it is running on the internet now. When the validations fail and go to the page where there is a back button, when it is pressed all the values are gone from the registration page with no valdiation errors. Is this possible? What could have happened?
Regards,
J Roq
PS: This is the JSP code where I think it goes wrong, this is the code that will render the page with the back button:
<c:if
test="${!empty sessionScope.RegistrationForm.problamticCode}">
<br><br></br><input type="button" value="BACK"
onclick="javascript:history.go(-1)" />
</c:if>
<c:if
test="${empty sessionScope.RegistrationForm.problamticCode}">
<%request.getSession().removeAttribute("registrationFormObject"); %>
</c:if>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
导致行为不同的原因有很多,包括:浏览器类型、浏览器版本、安全设置。这只是在客户端:还有许多服务器端问题需要考虑。
建议:
尝试使用 Dynamic Drive 中的“formretain.js”,看看它是否可以解决问题:
另外,本文有一些很好的背景:
There are a huge number of reasons why it might be behaving differently, including: Browser type, browser version, security settings. And that's just on the client side: there are many server-side issues to consider, too.
SUGGESTION:
Try "formretain.js", from Dynamic Drive, and see if it fixes the problem:
Also, this article has some great background: