Because the act of struts2 Ion is inherited from actionsupport. Every request from the client calls the execute method of this class and returns a string representing the JSP page. This is a mode for immediate response.
For continuation, if the resource is time-consuming and not ready, the current request suspend will be added to a queue without returning response (when to return: asynchronous notification when the resource is ready, for example Responsecomplete event), and then release the servlet processing thread allocated to the request back to the thread pool. this is a pattern in which requests are not responded immediately (when to construct the response returned content to the client is determined by the server based on the remote request ).
Because of the differences between the two modes, the act is extended. Ion, it is difficult to support continuation: Act Ion is actually the servlet API's doget, dopost is encapsulated layer by layer, and external exposure is only the execute method.
Solution:
1. all use servlet to replace struts2. however, because the existing project already uses struts2, and the page uses a lot of struts labels. the transformation workload is large. only one balance can be made, and 2/8 of frequently sent requests will be transformed according to the 20% principle.
Note the pause function in struts2.
The pause function supports a meaningful conversation process between the client and the server, rather than a new request for each question and answer. it supports the multi-evaluate-one mode (in fact, the pause method is called multiple times in the execute method)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service