JSF simultaneous ajax calls

后端 未结 2 439
故里飘歌
故里飘歌 2021-01-05 04:16

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)?

2条回答
  •  再見小時候
    2021-01-05 05:11

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

    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.

提交回复
热议问题