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


Java TemplateProcessingException类代码示例

本文整理汇总了Java中org.thymeleaf.exceptions.TemplateProcessingException的典型用法代码示例。如果您正苦于以下问题:Java TemplateProcessingException类的具体用法?Java TemplateProcessingException怎么用?Java TemplateProcessingException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: parseExpression

import org.thymeleaf.exceptions.TemplateProcessingException; //导入依赖的package包/类
private Object parseExpression(IStandardExpressionParser expressionParser, ITemplateContext context, String attributeValue) {
	if (attributeValue == null) {
		return null;
	}

	Object result = null;

	try {
		IStandardExpression expression = expressionParser.parseExpression(context, attributeValue);
		result = expression.execute(context);
	} catch (TemplateProcessingException e) {
		result = attributeValue;
	}

	return result;
}
 
开发者ID:dtrunk90,项目名称:thymeleaf-jawr-extension,代码行数:17,代码来源:AbstractJawrAttributeTagProcessor.java

示例2: handleError

import org.thymeleaf.exceptions.TemplateProcessingException; //导入依赖的package包/类
static RuntimeException handleError( final RuntimeException e )
{
    if ( e instanceof TemplateProcessingException )
    {
        return handleError( (TemplateProcessingException) e );
    }

    return e;
}
 
开发者ID:purplejs,项目名称:purplejs,代码行数:10,代码来源:ThymeleafServiceImpl.java

示例3: computeFragment

import org.thymeleaf.exceptions.TemplateProcessingException; //导入依赖的package包/类
@Override
    @SuppressWarnings("unchecked")
    protected List<Node> computeFragment(final Arguments arguments, final Element element) {
        // The pageTitle attribute could be an expression that needs to be evaluated. Try to evaluate, but fall back
        // to its text value if the expression wasn't able to be processed. This will allow things like
        // pageTitle="Hello this is a string"
        // as well as expressions like
        // pageTitle="${'Hello this is a ' + product.name}"
        
        String pageTitle = element.getAttributeValue("pageTitle");
        try {
            Expression expression = (Expression) StandardExpressions.getExpressionParser(arguments.getConfiguration())
                    .parseExpression(arguments.getConfiguration(), arguments, pageTitle);
            pageTitle = (String) expression.execute(arguments.getConfiguration(), arguments);
        } catch (TemplateProcessingException e) {
            // Do nothing.
        }
        ((Map<String, Object>) arguments.getExpressionEvaluationRoot()).put("pageTitle", pageTitle);
        ((Map<String, Object>) arguments.getExpressionEvaluationRoot()).put("additionalCss", element.getAttributeValue("additionalCss"));

        extensionManager.processAttributeValues(arguments, element);
        
        //the commit at https://github.com/thymeleaf/thymeleaf/commit/b214d9b5660369c41538e023d4b8d7223ebcbc22 along with
        //the referenced issue at https://github.com/thymeleaf/thymeleaf/issues/205
        
        
//        return new FragmentAndTarget(HEAD_PARTIAL_PATH, WholeFragmentSpec.INSTANCE);
        return new ArrayList<Node>();
    }
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:30,代码来源:HeadProcessor.java

示例4: format

import org.thymeleaf.exceptions.TemplateProcessingException; //导入依赖的package包/类
@Override
public String format(final AbstractInstant target, String pattern) {
    try {
        return DateTimeFormat.forPattern(pattern).withLocale(locale).print(target);
    } catch (final Exception e) {
        throw new TemplateProcessingException(
                "Error formatting Joda DateTime with pattern '" + pattern + "' for locale " + this.locale, e);
    }
}
 
开发者ID:eveoh,项目名称:thymeleaf-joda,代码行数:10,代码来源:JodaImpl.java

示例5: imagePath

import org.thymeleaf.exceptions.TemplateProcessingException; //导入依赖的package包/类
public String imagePath(String src, boolean base64) {
	BinaryResourcesHandler binaryRsHandler = (BinaryResourcesHandler) context.getServletContext().getAttribute(JawrConstant.BINARY_CONTEXT_ATTRIBUTE);
	if (binaryRsHandler == null) {
		throw new TemplateProcessingException("Handler \"" + JawrConstant.BINARY_CONTEXT_ATTRIBUTE + "\" not present in servlet context. Initialization of Jawr either failed or never occurred.");
	}

	return ImageTagUtils.getImageUrl(src, base64, binaryRsHandler, context.getRequest(), context.getResponse());
}
 
开发者ID:dtrunk90,项目名称:thymeleaf-jawr-extension,代码行数:9,代码来源:Jawr.java

示例6: evaluateAsIterable

import org.thymeleaf.exceptions.TemplateProcessingException; //导入依赖的package包/类
public static List<Object> evaluateAsIterable(ITemplateContext arguments, String rawValue) throws TemplateProcessingException {
    notNull(arguments, "arguments must not be null");
    notEmpty(rawValue, "rawValue must not be empty");

    final Object evaluatedExpression = evaluateExpression(arguments, rawValue);

    return EvaluationUtils.evaluateAsList(evaluatedExpression);
}
 
开发者ID:theborakompanioni,项目名称:thymeleaf-extras-shiro,代码行数:9,代码来源:ThymeleafFacade.java

示例7: evaluateAsIterableOrRawValue

import org.thymeleaf.exceptions.TemplateProcessingException; //导入依赖的package包/类
public static List<Object> evaluateAsIterableOrRawValue(ITemplateContext arguments, String rawValue) {
    notNull(arguments, "arguments must not be null");
    notEmpty(rawValue, "rawValue must not be empty");

    final List<Object> result = new ArrayList<Object>();
    try {
        result.addAll(evaluateAsIterable(arguments, rawValue));
    } catch (TemplateProcessingException ex) {
        result.add(rawValue);
    }

    return unmodifiableList(result);
}
 
开发者ID:theborakompanioni,项目名称:thymeleaf-extras-shiro,代码行数:14,代码来源:ThymeleafFacade.java

示例8: evaluateExpression

import org.thymeleaf.exceptions.TemplateProcessingException; //导入依赖的package包/类
public static Object evaluateExpression(ITemplateContext arguments, String expression) throws TemplateProcessingException {
    notNull(arguments, "arguments must not be null");
    notEmpty(expression, "expression must not be empty");

    final IStandardExpressionParser parser = new StandardExpressionParser();

    final IStandardExpression evaluableExpression = parser.parseExpression(arguments, expression);

    return evaluableExpression.execute(arguments);
}
 
开发者ID:theborakompanioni,项目名称:thymeleaf-extras-shiro,代码行数:11,代码来源:ThymeleafFacade.java


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