How can I re-use chunks of TML markup between pages? I want to refactor repetitive code out into a component, similar to a tag file or a jsp include.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To create a Tapestry component, you create a component class and (usually) a .tml file in the components package of your Tapestry application.
An example component class that renders a single post in a blogging application:
The corresponding Post.tml:
You can then use your component in any of your pages, just like you use Tapestry’s built-in components: