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 TypeClassDescriptionclass
freemarker.core._MiscTemplateException
static class
The setting name was recognized, but its value couldn't be parsed or the setting couldn't be set for some other reason.static class
The setting name was not recognized.class
A subclass ofTemplateException
that says that an FTL expression has evaluated tonull
or it refers to something that doesn't exist.class
Indicates that aTemplateBooleanModel
value was expected, but the value had a different type.class
Indicates that aTemplateDateModel
value was expected, but the value had a different type.class
Indicates that aTemplateHashModelEx
value was expected, but the value had a different type.class
Indicates that aTemplateNodeModelEx
value was expected, but the value had a different type.class
Indicates that aTemplateHashModel
value was expected, but the value had a different type.class
Indicates that aTemplateMarkupOutputModel
value was expected, but the value had a different type.class
Indicates that aTemplateMethodModel
value was expected, but the value had a different type.class
Indicates that aTemplateNodeModel
value was expected, but the value had a different type.class
Indicates that aTemplateNumberModel
value was expected, but the value had a different type.class
Indicates that aTemplateSequenceModel
value was expected, but the value had a different type.class
Indicates that aTemplateSequenceModel
orTemplateCollectionModel
value was expected, but the value had a different type.class
Indicates that aTemplateScalarModel
value was expected (or maybe something that can be automatically coerced to that), but the value had a different type.class
Indicates that aTemplateScalarModel
(or maybe something that can be automatically coerced to that) orTemplateMarkupOutputModel
value was expected, but the value had a different type.class
This exception is thrown when a #stop directive is encountered.class
The type of a value differs from what was expected.Methods in freemarker.core that return TemplateExceptionModifier and TypeMethodDescriptionprotected TemplateException
Configurable.invalidSettingValueException
(String name, String value) protected TemplateException
Configurable.settingValueAssignmentException
(String name, String value, Throwable cause) protected TemplateException
Configurable.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 TypeMethodDescriptionvoid
Environment.__setitem__
(String key, Object o) A hook that Jython uses.abstract Number
boolean
Environment.applyEqualsOperator
(TemplateModel leftValue, TemplateModel rightValue) Compares twoTemplateModel
-s according the rules of the FTL "==" operator.boolean
Environment.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.boolean
Environment.applyGreaterThanOperator
(TemplateModel leftValue, TemplateModel rightValue) Compares twoTemplateModel
-s according the rules of the FTL ">" operator.boolean
Environment.applyLessThanOperator
(TemplateModel leftValue, TemplateModel rightValue) Compares twoTemplateModel
-s according the rules of the FTL "<" operator.boolean
Environment.applyLessThanOrEqualsOperator
(TemplateModel leftValue, TemplateModel rightValue) Compares twoTemplateModel
-s according the rules of the FTL "<" operator.boolean
Environment.applyWithGreaterThanOrEqualsOperator
(TemplateModel leftValue, TemplateModel rightValue) Compares twoTemplateModel
-s according the rules of the FTL ">=" operator.abstract int
ArithmeticEngine.compareNumbers
(Number first, Number second) int
ArithmeticEngine.ConservativeEngine.compareNumbers
(Number first, Number second) abstract Number
protected void
Configurable.doAutoImportsAndIncludes
(Environment env) Executes the auto-imports and auto-includes for the main template of this environment.Does what the#import
directive does, but with an already loaded template.Emulatesimport
directive, except thattemplateName
must be template root relative.LikeEnvironment.importLib(String, String)
, but you can specify if you want a lazy import or not.void
Processes a Template in the context of thisEnvironment
, including its output in theEnvironment
's Writer.void
Emulatesinclude
directive, except thatname
must be template root relative.abstract Number
abstract Number
void
Environment.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 aClass
based on the class name.void
Configurable.setSetting
(String name, String value) Sets a FreeMarker setting by a name and string value.void
Configurable.setSettings
(InputStream propsIn) Reads a setting list (key and element pairs) from the input stream.void
Configurable.setSettings
(Properties props) Set the settings stored in aProperties
object.abstract Number
DefaultTruncateBuiltinAlgorithm.truncate
(String s, int maxLength, TemplateScalarModel terminator, Integer terminatorLength, Environment env) abstract TemplateScalarModel
TruncateBuiltinAlgorithm.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 TemplateScalarModel
TruncateBuiltinAlgorithm.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 TemplateModel
TruncateBuiltinAlgorithm.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 TemplateModel
TruncateBuiltinAlgorithm.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 TemplateScalarModel
TruncateBuiltinAlgorithm.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 TemplateModel
TruncateBuiltinAlgorithm.truncateWM
(String s, int maxLength, TemplateModel terminator, Integer terminatorLength, Environment env) Corresponds to?truncate_w_m(...)
in templates.void
Environment.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 TypeClassDescriptionclass
An 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 TypeMethodDescriptionvoid
IncludePage.execute
(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) protected void
FreemarkerServlet.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 TypeClassDescriptionclass
ObjectWrapper
-s may throw this when wrapping/unwrapping fails, orTemplateModel
methods throw this if the requested data can't be retrieved.Methods in freemarker.template with parameters of type TemplateExceptionModifier and TypeMethodDescriptionvoid
TemplateExceptionHandler.handleTemplateException
(TemplateException te, Environment env, Writer out) Method called after aTemplateException
was raised inside a template.void
AttemptExceptionReporter.report
(TemplateException te, Environment env) Called to log or otherwise report the error that has occurred inside an#attempt
block.Methods in freemarker.template that throw TemplateExceptionModifier and TypeMethodDescriptionTemplate.createProcessingEnvironment
(Object dataModel, Writer out) Template.createProcessingEnvironment
(Object dataModel, Writer out, ObjectWrapper wrapper) Creates aEnvironment
object, using this template, the data-model provided as parameter.protected void
Configuration.doAutoImportsAndIncludes
(Environment env) void
TemplateDirectiveModel.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.void
TemplateExceptionHandler.handleTemplateException
(TemplateException te, Environment env, Writer out) Method called after aTemplateException
was raised inside a template.void
Executes template, using the data-model provided, writing the generated output to the suppliedWriter
.void
Template.process
(Object dataModel, Writer out, ObjectWrapper wrapper) LikeTemplate.process(Object, Writer)
, but overrides theConfigurable.getObjectWrapper()
.void
Template.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.void
Renders the body of the directive body to the specified writer.void
Configuration.setSetting
(String name, String value)