Last active
August 29, 2015 14:06
-
-
Save uklance/a6bda84895b7912b7999 to your computer and use it in GitHub Desktop.
Dynamic template usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyPage { | |
@Inject | |
private DynamicTemplateParser parser; | |
public DynamicTemplate getMyDynamicTemplate() { | |
// if you want this to come from a string you might need to | |
// implement a StringResource by extending AbstractResource | |
Resource resource = new ClasspathResource("path/to/some-template.tml"); | |
return parser.parseTemplate(resource); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"> | |
<body> | |
<t:dynamic template="prop:myDynamicTemplate" /> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment