JSF同时ajax调用 [英] JSF simultaneous ajax calls

查看:128
本文介绍了JSF同时ajax调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能与JSF进行Ajax调用,将同时执行(不等待previous呼吁开始一个新的前完成)?

Is it possible with JSF to make ajax calls that will execute simultaneously (not waiting for previous calls to finish before starting a new one)?

推荐答案

没有,他们明确地规范排队,没有任何异常。请参阅 JSF 2规范:

No, they are explicitly queued by specification, without any exception. See chapter 13.3.2 of the JSF 2 specification:

所有Ajax请求必须被放入一个客户端的请求队列,他们被送到之前   服务器,以确保Ajax请求在它们被发送的顺序进行处理。已在队列中等待的请求   最长是下一个请求被发送。后发送一个请求,Ajax请求回调函数必须删除请求   从队列(也称为出列)。如果请求成功完成后,必须将其从队列中删除。如果   有一个错误,客户端必须通知,但请求仍必须从队列,以便下一个请求删除   可以被发送。下一个请求(在队列中的最老的请求)必须发送。请参阅 jsf.ajax.request   JavaScript的文档,了解关于Ajax请求队列中更多的细节。

13.3.2 Ajax Request Queueing

All Ajax requests must be put into a client side request queue before they are sent to the server to ensure Ajax requests are processed in the order they are sent. The request that has been waiting in the queue the longest is the next request to be sent. After a request is sent, the Ajax request callback function must remove the request from the queue (also known as dequeuing). If the request completed successfully, it must be removed from the queue. If there was an error, the client must be notified, but the request must still be removed from the queue so the next request can be sent. The next request (the oldest request in the queue) must be sent. Refer to the jsf.ajax.request JavaScript documentation for more specifics about the Ajax request queue.

这是这样做的,以确保在其他视图范围豆在服务器端线程安全的。

This is done so to ensure thread safety of among others the view scoped beans in the server side.

这篇关于JSF同时ajax调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆