当前位置: 首页>>代码示例>>Java>>正文


Java TemplateProcessingParameters.getTemplateName方法代码示例

本文整理汇总了Java中org.thymeleaf.TemplateProcessingParameters.getTemplateName方法的典型用法代码示例。如果您正苦于以下问题:Java TemplateProcessingParameters.getTemplateName方法的具体用法?Java TemplateProcessingParameters.getTemplateName怎么用?Java TemplateProcessingParameters.getTemplateName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.thymeleaf.TemplateProcessingParameters的用法示例。


在下文中一共展示了TemplateProcessingParameters.getTemplateName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resolveTemplate

import org.thymeleaf.TemplateProcessingParameters; //导入方法依赖的package包/类
@Override
public TemplateResolution resolveTemplate(TemplateProcessingParameters templateProcessingParameters) {
	String unresolvedTemplateName = templateProcessingParameters.getTemplateName();
	ResourceResolver supportingResolver = resolver.getSupportingResolver(unresolvedTemplateName);
	ITemplateResolver templateResolver;
	try {
		templateResolver = resolverAdapter.adapt(supportingResolver);
		if (forceInitialize) {
			// we must initialize the new templateResolver
			templateResolver.initialize();
		}
		String resolvedPath = supportingResolver.getResourcePath(unresolvedTemplateName).getResolvedPath();
		TemplateProcessingParameters resolvedTemplateProcessingParameters = new TemplateProcessingParameters(templateProcessingParameters.getConfiguration(), resolvedPath,
				templateProcessingParameters.getContext());
		return templateResolver.resolveTemplate(resolvedTemplateProcessingParameters);
	} catch (NoResolverAdapterException e) {
		throw new ResolverAdapterNotFoundException("Unable to resolver template cause no adapter supporting template name '" + unresolvedTemplateName + "' was found. ", e);

	}

}
 
开发者ID:groupe-sii,项目名称:ogham,代码行数:22,代码来源:ThymeLeafFirstSupportingTemplateResolver.java

示例2: computeResourceName

import org.thymeleaf.TemplateProcessingParameters; //导入方法依赖的package包/类
@Override
protected String computeResourceName(final TemplateProcessingParameters templateProcessingParameters) {
    String themePath = null;

    Theme theme = BroadleafRequestContext.getBroadleafRequestContext().getTheme();
    if (theme != null && theme.getPath() != null) {
        themePath = theme.getPath();
    }             

    checkInitialized();

    final String templateName = templateProcessingParameters.getTemplateName();

    Validate.notNull(templateName, "Template name cannot be null");

    String unaliasedName = this.getTemplateAliases().get(templateName);
    if (unaliasedName == null) {
        unaliasedName = templateName;
    }

    final StringBuilder resourceName = new StringBuilder();
    String prefix = this.getPrefix();
    if (prefix != null && ! prefix.trim().equals("")) {
       
        if (themePath != null) {        
            resourceName.append(prefix).append(themePath).append('/').append(templateFolder);
        }
    }
    resourceName.append(unaliasedName);
    String suffix = this.getSuffix();
    if (suffix != null && ! suffix.trim().equals("")) {
        resourceName.append(suffix);
    }

    return resourceName.toString();
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:37,代码来源:BroadleafThymeleafServletContextTemplateResolver.java

示例3: computeResourceName

import org.thymeleaf.TemplateProcessingParameters; //导入方法依赖的package包/类
@Override
protected String computeResourceName(final TemplateProcessingParameters templateProcessingParameters) {
    String themePath = null;

    Theme theme = SparkRequestContext.getSparkRequestContext().getTheme();
    if (theme != null && theme.getPath() != null) {
        themePath = theme.getPath();
    }             

    checkInitialized();

    final String templateName = templateProcessingParameters.getTemplateName();

    Validate.notNull(templateName, "Template name cannot be null");

    String unaliasedName = this.getTemplateAliases().get(templateName);
    if (unaliasedName == null) {
        unaliasedName = templateName;
    }

    final StringBuilder resourceName = new StringBuilder();
    String prefix = this.getPrefix();
    if (prefix != null && ! prefix.trim().equals("")) {
       
        if (themePath != null) {        
            resourceName.append(prefix).append(themePath).append('/').append(templateFolder);
        }
    }
    resourceName.append(unaliasedName);
    String suffix = this.getSuffix();
    if (suffix != null && ! suffix.trim().equals("")) {
        resourceName.append(suffix);
    }

    return resourceName.toString();
}
 
开发者ID:akdasari,项目名称:SparkCommerce,代码行数:37,代码来源:SparkThymeleafServletContextTemplateResolver.java

示例4: resolveTemplate

import org.thymeleaf.TemplateProcessingParameters; //导入方法依赖的package包/类
@Override
public TemplateResolution resolveTemplate(TemplateProcessingParameters theTemplateProcessingParameters) {

	String templateName = theTemplateProcessingParameters.getTemplateName();
	ourLog.info("Resolving template: {}", templateName);

	return null;
}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:9,代码来源:ThymeleafResolver.java

示例5: resolveTemplate

import org.thymeleaf.TemplateProcessingParameters; //导入方法依赖的package包/类
@Override
public TemplateResolution resolveTemplate(TemplateProcessingParameters templateProcessingParameters) {

    String templateName = templateProcessingParameters.getTemplateName();
    String resourceName = "";
    // TODO Get character encoding from the capability
    String characterEncoding = "UTF8";
    // TODO Get the mode from the capability if specified
    String templateMode = StandardTemplateModeHandlers.XHTML.getTemplateModeName();
    ITemplateResolutionValidity validity = null;
    new TemplateResolution(templateName, resourceName, resourceResolver, characterEncoding, templateMode, validity);
    return null;
}
 
开发者ID:everit-org-archive,项目名称:thymeleaf-extender,代码行数:14,代码来源:OSGiTemplateResolver.java

示例6: computeResourceName

import org.thymeleaf.TemplateProcessingParameters; //导入方法依赖的package包/类
@Override
protected String computeResourceName(TemplateProcessingParameters params){
    return params.getTemplateName();
}
 
开发者ID:mattpwest,项目名称:entelect-spring-webapp-template,代码行数:5,代码来源:DbTemplateResolver.java

示例7: computeResourceName

import org.thymeleaf.TemplateProcessingParameters; //导入方法依赖的package包/类
@Override
protected String computeResourceName(TemplateProcessingParameters templateProcessingParameters) {
	String templateName = templateProcessingParameters.getTemplateName();
	return templateName.substring(PREFIX.length());
}
 
开发者ID:tkaczmarzyk,项目名称:th-db-view,代码行数:6,代码来源:DbTemplateResolver.java

示例8: computeResourceName

import org.thymeleaf.TemplateProcessingParameters; //导入方法依赖的package包/类
@Override
protected String computeResourceName(TemplateProcessingParameters templateProcessingParameters)
{
    SiteContext siteContext = (SiteContext)templateProcessingParameters.getContext();
    return getPrefix() + siteContext.getSiteKey() + File.separator + "templates" + File.separator + templateProcessingParameters.getTemplateName() + getSuffix();
}
 
开发者ID:dmmikkel,项目名称:Brisk,代码行数:7,代码来源:SiteTemplateResolver.java


注:本文中的org.thymeleaf.TemplateProcessingParameters.getTemplateName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。