T5 page lifecycle favorites
I sorted it out based on the official documents and understanding of tapestry. If anything is wrong, please criticize and correct it.
According to the official statement, the T5 page is cached in a page pool after the first access to facilitate access by other users.
The page lifecycle is also simple.
The function execution sequence for the first access to the page is as follows:
This is how tapestry instantiates the current page.
1. pageloaded can initialize some common page parameters here. The variable values here are shared with all requests.
2. pageattached attaches the page to the current request
3, pagepassivate this method can pass the context between pages see: http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html
4. pagedetached page to strip the current request.
5. pageattached attaches the page to the current request (the method has been executed twice here, but it is not clear yet)
6. pageactivate page activation function. This function is very useful. We need to perform user verification and initialize some parameters required by the current request.
7. The pagepassivate method can pass context between pages.
8. The pagedetached page splits the current request and returns it to the page pool.
When other users access the page, the execution sequence of the page method is the same as that above, but the pageloaded method is missing, because the page already exists in the page pool and can be directly used.
, Greatly improving the page execution speed. Note that other users are requesting this page, not refreshing this page.