WebSphere集群环境下Action方法被多次调用
我们正在经历一个奇怪的场景。我们的页面上有一个命令链接/按钮,每当用户单击它时,操作方法就会被多次调用。这种情况仅发生在集群环境中。
我们在 Websphere Portal 6.2 上使用 JSF 1.2。我们尝试将 enableHighCompatibility
设置为 true
并在操作方法完成后调用 facesContext.renderResponse()
,只是为了让框架了解:操作已完成,请渲染页面。
上面的2已经规定了最多调用一次,但是我们仍然有一些场景需要多次调用backing bean中的action方法。
We are running on a wierd scenario. We have a commandlink/button on our page and whenever user clicks on it the action method is being called multiple times. This is happening in clustered environment only.
We are using JSF 1.2 on Websphere portal 6.2. We tried to set enableHighCompatibility
to true
and to call facesContext.renderResponse()
after the action method is completed, just to make the framework understand that action is done, please render the page.
The above 2 has made maximum to call once, but still we have some scenarios which is calling multiple times the action method in the backing bean.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果这种情况发生在
Websphere
Application Server 7 (WAS7) 中,原因可能是您的读/写超时值。 WAS7 在下面包含一个新的管理控制台参数(在 WAS6 中不可用)该值默认为 60 秒。因此,如果您的交易需要超过 60 秒才能完成,则会触发第二次表单提交。
可以通过将超时值更改为 0 秒(WAS 中的 0 表示无限)来避免这种情况。这将确保您的操作方法仅被调用一次。
If this is happening in
Websphere
Application Server 7 (WAS7), the reason might be your read/write timeout value. WAS7 has a new admin console parameter included (which is not available in WAS6) underThis value is defaulted to 60 seconds. So if your transaction takes more than 60 seconds to complete, a second form submission is triggered.
This can be avoided by changing the timeout value to 0 seconds (0 means infinite in WAS). This will ensure your action method is called only once.