Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the execution order of Tapestry functions?

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how the execution order of Tapestry functions is, which is very detailed and has certain reference value. Friends who are interested must finish reading it.

1. Protected void finishLoad () {}

In the order in which the Tapestry function is executed, this function is called only when there is no page class in the page pool and a new page object needs to be generated. Here's a trap: if tomcat starts with-Dorg.apache.Tapestry.disable-caching=true (set for debugging convenience), it executes every time the page is refreshed (because each request generates a new page class object), creating the illusion that it always executes. If false is used in the actual deployment, there is little chance that this function will be executed. The initialization code is placed in 4 pageBeginRender ().

2. Public void pageValidate (PageEvent event) {}

If you implement the PageValidateListener interface, you can verify it here, such as access rights, etc.

3. Public void activateExternalPage (Object [] parameters, IRequestCycle cycle) {}

If you implement the IExternalPage interface, you can get the parameters passed from the outside and assign them to the page class.

4. Public void pageBeginRender (PageEvent event) {}

Some initialization operations can be done here. At this point, however, the parameters passed from the client have not yet been assigned (if a form has been submitted).

5. Tapestry function execution order. If there is a form submission, those values will be taken out here and assigned to the corresponding fields. In other words, if a form is submitted, the values of each field in the form are assigned to the page class. (note: just assign the values in the form)

6. Public void submit ()

If there is a form submission, the corresponding operation will be done here, that is, the listenter: method called by the form submission and so on. Because each field has already taken the value at this time, it can be used directly.

7. Protected void prepareForRender (IRequestCycle cycle) {}

You can perform operations to display data on the page, such as what object to get, because the property assignment of the page class has been completed, and the execution order of the Tapestry function can be used directly.

8. Public void pageEndRender (PageEvent event) {}

This method is executed only by *.

These are all the contents of the article "what is the order in which Tapestry functions are executed?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 204

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report