Struts tiles - is each tile asynchronous?

I've had experience with racks and have experimented briefly with tiles. I know that in the layout, each tile is a separate jsp page. Suppose I clicked a button on each of the four tiles and each tile (indirectly) calls a different web service. Will the Affirmed Updates be updated at different points in time?

+1


source to share


2 answers


Tiles are just fragments of one html page. There is no concept of ajax unless you add it manually. To do this: clicking 4 buttons on one page will be the same as clicking 4 links on any html page. The browser will send a corresponding request to the server. When the server responds very quickly, you won't even have time to press the second button. When it's slow enough, the first request (browser to server) will be canceled and the second (third, fourth) will be sent (and canceled when the next button is pressed).



The rest depends on the backend implementation: at some point the server will notice that it cannot send back data for 3 out of 4 requests. What will be served / displayed in the last (open) answer also depends on your implementation. If there is any server side state containing the web services response, all 4 results can be displayed. If one web service hasn't returned yet, only 3 results and one old tile may appear.

+4


source


I guess it will depend on the code in the background. You say the tiles were calling web services indirectly. I would have thought it would update asynchronously unless you specified in your code that it does not. Let's say you press button 1 and then button 2. Action 1 returns and your code says the screen needs to be refreshed and the page refreshes. As soon as activity 2 returns, your code will refresh the screen again. I believe this is how it works, but without trying it I cannot be sure.



Why not just lay out two tiled test page with buttons and give it a try. This should give you the definitive answer.

+1


source