本文整理汇总了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);
}
}
示例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();
}
示例4: resolveTemplate
import org.thymeleaf.TemplateProcessingParameters; //导入方法依赖的package包/类
@Override
public TemplateResolution resolveTemplate(TemplateProcessingParameters theTemplateProcessingParameters) {
String templateName = theTemplateProcessingParameters.getTemplateName();
ourLog.info("Resolving template: {}", templateName);
return null;
}
示例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;
}
示例6: computeResourceName
import org.thymeleaf.TemplateProcessingParameters; //导入方法依赖的package包/类
@Override
protected String computeResourceName(TemplateProcessingParameters params){
return params.getTemplateName();
}
示例7: computeResourceName
import org.thymeleaf.TemplateProcessingParameters; //导入方法依赖的package包/类
@Override
protected String computeResourceName(TemplateProcessingParameters templateProcessingParameters) {
String templateName = templateProcessingParameters.getTemplateName();
return templateName.substring(PREFIX.length());
}
示例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();
}