Uses of Class
freemarker.template.TemplateException
Packages that use TemplateException
Package
Description
The seldom used or advanced parts of the fundamental FreeMarker API, compared to
freemarker.template.The default object wrapper of FreeMarker uses
this to expose Java Beans and POJO-s to templates.
Servlet for legacy "Model 2" frameworks that allows using FreeMarker
templates instead of JSP as the MVC View
(see in the Manual).
The fundamental, most commonly used API-s of FreeMarker;
start with
Configuration (see also the
Getting Started in the Manual.)-
Uses of TemplateException in freemarker.core
Subclasses of TemplateException in freemarker.coreModifier and TypeClassDescriptionclassfreemarker.core._MiscTemplateExceptionstatic classThe setting name was recognized, but its value couldn't be parsed or the setting couldn't be set for some other reason.static classThe setting name was not recognized.classA subclass ofTemplateExceptionthat says that an FTL expression has evaluated tonullor it refers to something that doesn't exist.classIndicates that aTemplateBooleanModelvalue was expected, but the value had a different type.classIndicates that aTemplateDateModelvalue was expected, but the value had a different type.classIndicates that aTemplateHashModelExvalue was expected, but the value had a different type.classIndicates that aTemplateNodeModelExvalue was expected, but the value had a different type.classIndicates that aTemplateHashModelvalue was expected, but the value had a different type.classIndicates that aTemplateMarkupOutputModelvalue was expected, but the value had a different type.classIndicates that aTemplateMethodModelvalue was expected, but the value had a different type.classIndicates that aTemplateNodeModelvalue was expected, but the value had a different type.classIndicates that aTemplateNumberModelvalue was expected, but the value had a different type.classIndicates that aTemplateSequenceModelvalue was expected, but the value had a different type.classIndicates that aTemplateSequenceModelorTemplateCollectionModelvalue was expected, but the value had a different type.classIndicates that aTemplateScalarModelvalue was expected (or maybe something that can be automatically coerced to that), but the value had a different type.classIndicates that aTemplateScalarModel(or maybe something that can be automatically coerced to that) orTemplateMarkupOutputModelvalue was expected, but the value had a different type.classThis exception is thrown when a #stop directive is encountered.classThe type of a value differs from what was expected.Methods in freemarker.core that return TemplateExceptionModifier and TypeMethodDescriptionprotected TemplateExceptionConfigurable.invalidSettingValueException(String name, String value) protected TemplateExceptionConfigurable.settingValueAssignmentException(String name, String value, Throwable cause) protected TemplateExceptionConfigurable.unknownSettingException(String name) Creates the exception that should be thrown when a setting name isn't recognized.Methods in freemarker.core that throw TemplateExceptionModifier and TypeMethodDescriptionvoidEnvironment.__setitem__(String key, Object o) A hook that Jython uses.abstract NumberbooleanEnvironment.applyEqualsOperator(TemplateModel leftValue, TemplateModel rightValue) Compares twoTemplateModel-s according the rules of the FTL "==" operator.booleanEnvironment.applyEqualsOperatorLenient(TemplateModel leftValue, TemplateModel rightValue) Compares twoTemplateModel-s according the rules of the FTL "==" operator, except that if the two types are incompatible, they are treated as non-equal instead of throwing an exception.booleanEnvironment.applyGreaterThanOperator(TemplateModel leftValue, TemplateModel rightValue) Compares twoTemplateModel-s according the rules of the FTL ">" operator.booleanEnvironment.applyLessThanOperator(TemplateModel leftValue, TemplateModel rightValue) Compares twoTemplateModel-s according the rules of the FTL "<" operator.booleanEnvironment.applyLessThanOrEqualsOperator(TemplateModel leftValue, TemplateModel rightValue) Compares twoTemplateModel-s according the rules of the FTL "<" operator.booleanEnvironment.applyWithGreaterThanOrEqualsOperator(TemplateModel leftValue, TemplateModel rightValue) Compares twoTemplateModel-s according the rules of the FTL ">=" operator.abstract intArithmeticEngine.compareNumbers(Number first, Number second) intArithmeticEngine.ConservativeEngine.compareNumbers(Number first, Number second) abstract Numberprotected voidConfigurable.doAutoImportsAndIncludes(Environment env) Executes the auto-imports and auto-includes for the main template of this environment.Does what the#importdirective does, but with an already loaded template.Emulatesimportdirective, except thattemplateNamemust be template root relative.LikeEnvironment.importLib(String, String), but you can specify if you want a lazy import or not.voidProcesses a Template in the context of thisEnvironment, including its output in theEnvironment's Writer.voidEmulatesincludedirective, except thatnamemust be template root relative.abstract Numberabstract NumbervoidEnvironment.process()Processes the template to which this environment belongs to.OptInTemplateClassResolver.resolve(String className, Environment env, Template template) TemplateClassResolver.resolve(String className, Environment env, Template template) Gets aClassbased on the class name.voidConfigurable.setSetting(String name, String value) Sets a FreeMarker setting by a name and string value.voidConfigurable.setSettings(InputStream propsIn) Reads a setting list (key and element pairs) from the input stream.voidConfigurable.setSettings(Properties props) Set the settings stored in aPropertiesobject.abstract NumberDefaultTruncateBuiltinAlgorithm.truncate(String s, int maxLength, TemplateScalarModel terminator, Integer terminatorLength, Environment env) abstract TemplateScalarModelTruncateBuiltinAlgorithm.truncate(String s, int maxLength, TemplateScalarModel terminator, Integer terminatorLength, Environment env) Corresponds to?truncate(...)in templates.DefaultTruncateBuiltinAlgorithm.truncateC(String s, int maxLength, TemplateScalarModel terminator, Integer terminatorLength, Environment env) abstract TemplateScalarModelTruncateBuiltinAlgorithm.truncateC(String s, int maxLength, TemplateScalarModel terminator, Integer terminatorLength, Environment env) Corresponds to?truncate_c_m(...)in templates.DefaultTruncateBuiltinAlgorithm.truncateCM(String s, int maxLength, TemplateModel terminator, Integer terminatorLength, Environment env) abstract TemplateModelTruncateBuiltinAlgorithm.truncateCM(String s, int maxLength, TemplateModel terminator, Integer terminatorLength, Environment env) Corresponds to?truncate_c_m(...)in templates.DefaultTruncateBuiltinAlgorithm.truncateM(String s, int maxLength, TemplateModel terminator, Integer terminatorLength, Environment env) abstract TemplateModelTruncateBuiltinAlgorithm.truncateM(String s, int maxLength, TemplateModel terminator, Integer terminatorLength, Environment env) Corresponds to?truncate_m(...)in templates.DefaultTruncateBuiltinAlgorithm.truncateW(String s, int maxLength, TemplateScalarModel terminator, Integer terminatorLength, Environment env) abstract TemplateScalarModelTruncateBuiltinAlgorithm.truncateW(String s, int maxLength, TemplateScalarModel terminator, Integer terminatorLength, Environment env) Corresponds to?truncate_w(...)in templates.DefaultTruncateBuiltinAlgorithm.truncateWM(String s, int maxLength, TemplateModel terminator, Integer terminatorLength, Environment env) abstract TemplateModelTruncateBuiltinAlgorithm.truncateWM(String s, int maxLength, TemplateModel terminator, Integer terminatorLength, Environment env) Corresponds to?truncate_w_m(...)in templates.voidEnvironment.visit(freemarker.core.TemplateElement element, TemplateDirectiveModel directiveModel, Map args, List bodyParameterNames) Deprecated.Should be internal API -
Uses of TemplateException in freemarker.ext.beans
Subclasses of TemplateException in freemarker.ext.beansModifier and TypeClassDescriptionclassAn exception thrown when there is an attempt to access an invalid bean property when we are in a "strict bean" mode -
Uses of TemplateException in freemarker.ext.servlet
Methods in freemarker.ext.servlet that throw TemplateExceptionModifier and TypeMethodDescriptionvoidIncludePage.execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) protected voidFreemarkerServlet.processEnvironment(Environment env, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) This is the method that actually executes the template. -
Uses of TemplateException in freemarker.template
Subclasses of TemplateException in freemarker.templateModifier and TypeClassDescriptionclassObjectWrapper-s may throw this when wrapping/unwrapping fails, orTemplateModelmethods throw this if the requested data can't be retrieved.Methods in freemarker.template with parameters of type TemplateExceptionModifier and TypeMethodDescriptionvoidTemplateExceptionHandler.handleTemplateException(TemplateException te, Environment env, Writer out) Method called after aTemplateExceptionwas raised inside a template.voidAttemptExceptionReporter.report(TemplateException te, Environment env) Called to log or otherwise report the error that has occurred inside an#attemptblock.Methods in freemarker.template that throw TemplateExceptionModifier and TypeMethodDescriptionTemplate.createProcessingEnvironment(Object dataModel, Writer out) Template.createProcessingEnvironment(Object dataModel, Writer out, ObjectWrapper wrapper) Creates aEnvironmentobject, using this template, the data-model provided as parameter.protected voidConfiguration.doAutoImportsAndIncludes(Environment env) voidTemplateDirectiveModel.execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) Executes this user-defined directive; called by FreeMarker when the user-defined directive is called in the template.voidTemplateExceptionHandler.handleTemplateException(TemplateException te, Environment env, Writer out) Method called after aTemplateExceptionwas raised inside a template.voidExecutes template, using the data-model provided, writing the generated output to the suppliedWriter.voidTemplate.process(Object dataModel, Writer out, ObjectWrapper wrapper) LikeTemplate.process(Object, Writer), but overrides theConfigurable.getObjectWrapper().voidTemplate.process(Object dataModel, Writer out, ObjectWrapper wrapper, TemplateNodeModel rootNode) LikeTemplate.process(Object, Writer), but also sets a (XML-)node to be recursively processed by the template.voidRenders the body of the directive body to the specified writer.voidConfiguration.setSetting(String name, String value)