Package org.thymeleaf.exceptions

Examples of org.thymeleaf.exceptions.TemplateProcessingException


        final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);
        final IStandardExpression expressionObj =
                expressionParser.parseExpression(configuration, processingContext, expression);

        if (expressionObj == null) {
            throw new TemplateProcessingException(
                    "Expression \"" + expression + "\" is not valid: cannot perform Spring bind");
        }

        if (expressionObj instanceof SelectionVariableExpression) {
            final String bindExpression = ((SelectionVariableExpression)expressionObj).getExpression();
            return getBindStatusFromParsedExpression(configuration, processingContext, optional, true, bindExpression);
        }

        if (expressionObj instanceof VariableExpression) {
            final String bindExpression = ((VariableExpression)expressionObj).getExpression();
            return getBindStatusFromParsedExpression(configuration, processingContext, optional, false, bindExpression);
        }

        throw new TemplateProcessingException(
                "Expression \"" + expression + "\" is not valid: only variable expressions ${...} or " +
                "selection expressions *{...} are allowed in Spring field bindings");

    }
View Full Code Here


        String name = bindStatus.getExpression();
        name = (name == null? "" : name);

        final String value = element.getAttributeValue("value");
        if (value == null) {
            throw new TemplateProcessingException(
                    "Attribute \"value\" is required in \"option\" tags");
        }
       
        final boolean selected =
            SelectedValueComparatorWrapper.isSelected(bindStatus, value);
View Full Code Here

       
        final String id = computeId(arguments, element, name, true);
       
        final String value = element.getAttributeValue("value");
        if (value == null) {
            throw new TemplateProcessingException(
                    "Attribute \"value\" is required in \"input(radio)\" tags");
        }
       
        final boolean checked =
            SelectedValueComparatorWrapper.isSelected(bindStatus, value);
View Full Code Here

           
        } else {
           
            value = element.getAttributeValue("value");
            if (value == null) {
                throw new TemplateProcessingException(
                        "Attribute \"value\" is required in \"input(checkbox)\" tags " +
                        "when binding to non-boolean values");
            }
           
            checked = SelectedValueComparatorWrapper.isSelected(bindStatus, value);
View Full Code Here

        String name = bindStatus.getExpression();
        name = (name == null? "" : name);

        final String value = element.getAttributeValue("value");
        if (value == null) {
            throw new TemplateProcessingException(
                    "Attribute \"value\" is required in \"option\" tags");
        }
       
        final boolean selected =
            SelectedValueComparatorWrapper.isSelected(bindStatus, value);
View Full Code Here

       
        final String id = computeId(arguments, element, name, true);
       
        final String value = element.getAttributeValue("value");
        if (value == null) {
            throw new TemplateProcessingException(
                    "Attribute \"value\" is required in \"input(radio)\" tags");
        }
       
        final boolean checked =
            SelectedValueComparatorWrapper.isSelected(bindStatus, value);
View Full Code Here

        final String fieldName = element.getAttributeValueFromNormalizedName("name");
        if (StringUtils.isEmptyOrWhitespace(fieldName)) {
            final String[] fieldProcessorNames =
                    Attribute.applyPrefixToAttributeName(
                            AbstractSpringFieldAttrProcessor.ATTR_NAME, Attribute.getPrefixFromAttributeName(attributeName));
            throw new TemplateProcessingException(
                    "Cannot apply \"" + attributeName + "\": this attribute requires the existence of " +
                    "a \"name\" (or " + Arrays.asList(fieldProcessorNames) + ") attribute with non-empty " +
                    "value in the same host tag.");
        }
View Full Code Here

        if (spring4Delegate != null) {
            return spring4Delegate.processAction(
                    requestContext, ((IWebContext)context).getHttpServletRequest(), action, httpMethod);
        }

        throw new TemplateProcessingException(
                "According to the detected Spring version info, a RequestDataValueProcessor delegate should be available, " +
                "but none seem applicable");

    }
View Full Code Here

        if (spring4Delegate != null) {
            return spring4Delegate.processFormFieldValue(
                    requestContext, ((IWebContext)context).getHttpServletRequest(), name, value, type);
        }

        throw new TemplateProcessingException(
                "According to the detected Spring version info, a RequestDataValueProcessor delegate should be available, " +
                "but none seem applicable");

    }
View Full Code Here

        if (spring4Delegate != null) {
            return spring4Delegate.getExtraHiddenFields(
                    requestContext, ((IWebContext)context).getHttpServletRequest());
        }

        throw new TemplateProcessingException(
                "According to the detected Spring version info, a RequestDataValueProcessor delegate should be available, " +
                "but none seem applicable");

    }
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.