• Post Reply Bookmark Topic Watch Topic
  • New Topic

why does jsf.js use a synchronous req here

 
Cedric Bosch
Ranch Hand
Posts: 99
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While checking the console on ajax req I was surprised that I had that warning message in the dev tool console:



After investigation it seems like this is the cause of this :



Why is it probably the only correct way ?? And when is this used ?

source : http://grepcode.com/file/repo1.maven.org/maven2/com.sun.faces/jsf-impl/2.2.12/META-INF/resources/javax.faces/jsf-uncompressed.js?av=f
 
Tim Holloway
Bartender
Posts: 18416
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, on casual reading of that code I'm not sure that it is a synchronous request. The comments could possibly be out of date.

There are 2 reasons why synchronous requests might be justified:

1. On the server side. If the request isn't idempotent, then having other requests serviced at the same time could scramble the results.

2. On the client side. If the xhs manager gets confused as to which received response it gets matches which request. Since web servers handle requests asynchronously (and often in parallel), it's possible for request A to precede request B, but get back request B's response before you got back the response for request A.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!