Package org.thymeleaf.exceptions

Examples of org.thymeleaf.exceptions.TemplateProcessingException


            throw e;
           
        } catch (final RuntimeException e) {
           
            logger.error("[THYMELEAF][{}] Exception processing template \"{}\": {}", new Object[] {TemplateEngine.threadIndex(), templateName, e.getMessage()});
            throw new TemplateProcessingException("Exception processing template", templateName, e);
           
        }
       
    }
View Full Code Here


                        Math.max(Math.max(leftNumberValue.scale(),rightNumberValue.scale()), 10),
                        RoundingMode.HALF_UP);
            }
        }
       
        throw new TemplateProcessingException(
            "Cannot execute division: operands are \"" + LiteralValue.unwrap(leftValue) + "\" and \"" + LiteralValue.unwrap(rightValue) + "\"");
       
    }
View Full Code Here

            logger.trace("[THYMELEAF][{}] Evaluating selection variable expression: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation());
        }
       
        final String exp = expression.getExpression();
        if (exp == null) {
            throw new TemplateProcessingException(
                    "Variable expression is null, which is not allowed");
        }

        final StandardExpressionExecutionContext evalExpContext =
                (expression.getConvertToString()? expContext.withTypeConversion() : expContext.withoutTypeConversion());
View Full Code Here

        if (leftNumberValue != null && rightNumberValue != null) {
            // Addition will act as a mathematical 'plus'
            return leftNumberValue.remainder(rightNumberValue);
        }
       
        throw new TemplateProcessingException(
            "Cannot execute division: operands are \"" + LiteralValue.unwrap(leftValue) + "\" and \"" + LiteralValue.unwrap(rightValue) + "\"");
       
    }
View Full Code Here

            final String messagesFileNameBase, final Locale locale) {

        final List<String> propertiesFileNames = new ArrayList<String>(5);
       
        if (StringUtils.isEmptyOrWhitespace(locale.getLanguage())) {
            throw new TemplateProcessingException(
                    "Locale \"" + locale.toString() + "\" " +
                    "cannot be used as it does not specify a language.");
        }
       
        if (!StringUtils.isEmptyOrWhitespace(locale.getVariant())) {
View Full Code Here

       
        final Map<String,Object> newLocalVariables =
                getNewLocalVariables(arguments, element);
       
        if (newLocalVariables == null) {
            throw new TemplateProcessingException("Null variables map for \"" +
                    element.getOriginalName() + "\" element not allowed");
        }
       
        if (removeHostElement) {
            element.getParent().extractChild(element);
View Full Code Here

            return fragNodes;
           
        } catch (final TemplateEngineException e) {
            throw e;
        } catch (final Exception e) {
            throw new TemplateProcessingException(
                    "An error happened during parsing of unescaped text: \"" + element.getOriginalName() + "\"", e);
        }
       
    }
View Full Code Here

                // would probably result in an infinite loop as the iteration processor
                // would be applied once and again. Instead, we create iterated elements
                // with a new name (iteratedElementName).
               
                if (iteratedElementName == null) {
                    throw new TemplateProcessingException(
                            "Cannot specify null iterated element name if the host iteration element is not being removed");
                }
               
                iterElement = element.cloneElementNodeWithNewName(parentNode, iteratedElementName, false);
               
View Full Code Here

   
    public String format(final Calendar target) {
        try {
            return DateUtils.format(target, this.locale);
        } catch (final Exception e) {
            throw new TemplateProcessingException(
                    "Error formatting calendar with standard format for locale " + this.locale, e);
        }
    }
View Full Code Here

   
    public String format(final Calendar target, final String pattern) {
        try {
            return DateUtils.format(target, pattern, this.locale);
        } catch (final Exception e) {
            throw new TemplateProcessingException(
                    "Error formatting calendar with format pattern \"" + pattern + "\"", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.thymeleaf.exceptions.TemplateProcessingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.