ajax - JSF同时ajax调用

标签 ajax jsf

是否可以使用 JSF 进行同时执行的 ajax 调用(在开始新调用之前不等待先前调用完成)?

最佳答案

不,它们按规范明确排队,没有任何异常(exception)。见JSF 2 specification的第13.3.2章:

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.


这样做是为了确保服务器端的 View 范围 bean 的线程安全。

关于ajax - JSF同时ajax调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7921296/

相关文章:

javascript - 如何通过 ajax 动态加载 list.js 并使排序继续工作

javascript - 在 AJAX 调用内部进行解析是一种不好的做法吗?

javascript - MooTools 表单请求在提交后恢复值

java - JSF 不显示第一行、第一列数据

jsf - 无法自动调整 p :dataExporter 中的列大小

jsf - 导入 javax.faces.bean.ManagedBean 时出现错误 "package javax.faces.bean does not exist"

javascript - dropzone 阻止单击按钮时提交表单

java - 使用 JSF 2.0 激活 FORM 身份验证时出现问题

jsf - 如何使用依赖对象关系更新多个组件(selectOneMenu)?

javascript - 无法使用 AJAX 获取 PHP 变量