POST 方法在 IE-9 中转换为 GET
我的 JSP 中有这行代码。 (我使用的是struts 1.3)
当调用与mine.do对应的操作时(使用struts-config.xml),页面将作为GET而不是POST提交。所有请求参数(包括必需的参数)都会因此而丢失。此问题仅在 IE-9 中发生。
当我使用其他版本的 IE 或任何其他浏览器时,响应仍为 POST。如何使响应在 IE-9 中保持为 POST ?
编辑:我在此发现了另一个问题。每当页面在新窗口中呈现时,就会出现此问题。在其他地方,POST 在 IE-9 中运行良好。
另外,这个问题在Win7/IE-8中出现,但在XP/IE-8中绝对正常。和操作系统也有关系吗???
任何解决方案都会有用。
谢谢!!
I have this line of code in my JSP. (I'm using struts 1.3)
<html:form action="screening/mine.do" method="post">
.
.
.
</html:form>
When the action corresponding to mine.do is invoked (using struts-config.xml), the page is getting submitted as GET instead of POST. All the request parameters including the required ones are getting lost due to this. This issue occcurs only in IE-9.
The response remains as POST when I use other versions of IE or any other browsers. How do I make the response to remain as POST in IE-9 ?
EDIT : I observed one more issue in this. Whenever the page is rendered in a new window, this issue occurs. Other places, the POST works fine in IE-9.
Also, this issue occurs in Win7/IE-8, but works absolutely fine in XP/IE-8. Is there something to do with the OS as well???
Any solutions would be useful.
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
此问题是由于 Windows 7 中 IE 的安全设置而发生的。Win-7 的 IE-8 中也会发生此问题。 (但在Win-XP的IE-8中工作正常)
在Windows-7的IE中有一个启用/禁用保护模式的选项。这是 Vista/Windows-7 IE 中的一项新功能,默认情况下为“Internet”区域和“本地 Intranet”区域(或其中任何一个)启用此选项。在这两个地方禁用解决了这个问题。
工具->互联网选项 ->安全->互联网/本地内联网 ->取消选中“启用保护模式”选项。
This issue was happening due to a security setting in IE in Windows 7. It also happens in IE-8 of Win-7. (But works fine in IE-8 of Win-XP)
There is an option of Enabling/Disabling protected mode in IE of Windows-7. This is a new feature present in IE of Vista/Windows-7 and this option is enabled by default for “Internet” zone and “Local Intranet” zone(or any one of them). Disabling at these 2 places solved the issue.
Tools -> Internet Options -> Security -> Internet/Local Intranet -> Uncheck on the "Enable protected mode" option.
TL;DR:确保两个站点也位于同一区域。我的站点位于两个不同的区域,调用区域堆栈会破坏 IE。
对于任何偶然发现这个问题的人(就像我一样),但发现保护模式设置无法解决它,我在另一个线程上写了这个: https://stackoverflow.com/a/12167814/649249
为我解决了。
TL;DR: Ensure the two sites are in the same zone as well. I had sites in two different zones and calling up the zone stack broke IE.
For anyone that stumbles across this (like I did), but finds that the Protected Mode setting doesn't resolve it, I wrote this up on another thread: https://stackoverflow.com/a/12167814/649249
Resolved it for me.
试试这个:
method="POST"
。该标准明确规定该方法可以具有值 GET | POST(注意大写字母)。
Try this:
method="POST"
.The standard specifically states that method can have the value GET | POST (note the caps).
我们注意到有一些安全警告会停止处理以便用户确认。一旦用户确认警告,浏览器就会发送 get 而不是 post。 IE8 中出现过这种情况,不知道 IE9 中是否还会出现这种情况。
We have noticed that there are some security warnings that halt the processing in order for the user to acknowledge. Once the use acknowledges the warning the browser sends a get rather than a post. This has been happening in IE8, not sure if it still happens in IE9.