Search in sources :

Example 1 with PageTemplateLocator

use of org.apache.tapestry5.internal.services.templates.PageTemplateLocator in project tapestry-5 by apache.

the class TapestryModule method contributeComponentTemplateLocator.

/**
 * Contributes two template locators:
 * <dl>
 * <dt>Default</dt>
 * <dd>Searches for the template on the classpath ({@link DefaultTemplateLocator}</dd>
 * <dt>Page</dt>
 * <dd>Searches for <em>page</em> templates in the context ({@link PageTemplateLocator})</dd>
 * </dl>
 *
 * @since 5.2.0
 */
public static void contributeComponentTemplateLocator(OrderedConfiguration<ComponentTemplateLocator> configuration, @ContextProvider AssetFactory contextAssetFactory, @Symbol(SymbolConstants.APPLICATION_FOLDER) String applicationFolder, ComponentClassResolver componentClassResolver) {
    configuration.add("Default", new DefaultTemplateLocator());
    configuration.add("Page", new PageTemplateLocator(contextAssetFactory.getRootResource(), componentClassResolver, applicationFolder));
}
Also used : PageTemplateLocator(org.apache.tapestry5.internal.services.templates.PageTemplateLocator) DefaultTemplateLocator(org.apache.tapestry5.internal.services.templates.DefaultTemplateLocator)

Aggregations

DefaultTemplateLocator (org.apache.tapestry5.internal.services.templates.DefaultTemplateLocator)1 PageTemplateLocator (org.apache.tapestry5.internal.services.templates.PageTemplateLocator)1