| <!doctype html> |
| <!-- Generated by FreeMarker/Docgen from DocBook --> |
| <html lang="en" class="page-type-section"> |
| <head prefix="og: http://ogp.me/ns#"> |
| <meta charset="utf-8"> |
| <title>2.3.20 - Apache FreeMarker Manual</title> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width,initial-scale=1"> |
| <meta name="format-detection" content="telephone=no"> |
| <meta property="og:site_name" content="Apache FreeMarker Manual"> |
| <meta property="og:title" content="2.3.20"> |
| <meta property="og:locale" content="en_US"> |
| <meta property="og:url" content="https://freemarker.apache.org/docs/versions_2_3_20.html"> |
| <link rel="canonical" href="https://freemarker.apache.org/docs/versions_2_3_20.html"> |
| <link rel="icon" href="favicon.png" type="image/png"> |
| <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:500,700,400,300|Droid+Sans+Mono"> |
| <link rel="stylesheet" type="text/css" href="docgen-resources/docgen.min.css?1707770044859"> |
| <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/cookie-bar/cookiebar-latest.min.js"></script> |
| </head> |
| <body itemscope itemtype="https://schema.org/Code"> |
| <meta itemprop="url" content="https://freemarker.apache.org/docs/"> |
| <meta itemprop="name" content="Apache FreeMarker Manual"> |
| |
| <!--[if lte IE 9]> |
| <div class="oldBrowserWarning" style="display: block"> |
| Unsupported web browser - Use a modern browser to view this website! |
| </div> |
| <![endif]--> <div class="oldBrowserWarning"> |
| Unsupported web browser - Use a modern browser to view this website! |
| </div> |
| <div class="header-top-bg"><div class="site-width header-top"><div id="hamburger-menu" role="button"></div> <div class="logo"> |
| <a href="https://freemarker.apache.org" role="banner"><img itemprop="image" src="logo.png" alt="FreeMarker"></a> </div> |
| <ul class="tabs"><li><a href="https://freemarker.apache.org/">Home</a></li><li class="current"><a href="index.html">Manual</a></li><li><a class="external" href="api/index.html">Java API</a></li></ul><ul class="secondary-tabs"><li><a class="tab icon-heart" href="https://freemarker.apache.org/contribute.html" title="Contribute"><span>Contribute</span></a></li><li><a class="tab icon-bug" href="https://issues.apache.org/jira/projects/FREEMARKER" title="Report a Bug"><span>Report a Bug</span></a></li><li><a class="tab icon-download" href="https://freemarker.apache.org/freemarkerdownload.html" title="Download"><span>Download</span></a></li></ul></div></div><div class="header-bottom-bg"><div class="site-width search-row"><a href="index.html" class="navigation-header">Manual</a><div class="navigation-header"></div><form method="get" class="search-form" action="search-results.html"><fieldset><legend class="sr-only">Search form</legend><label for="search-field" class="sr-only">Search query</label><input id="search-field" name="q" type="search" class="search-input" placeholder="Search" spellcheck="false" autocorrect="off" autocomplete="off"><button type="submit" class="search-btn"><span class="sr-only">Search</span></button></fieldset></form></div><div class="site-width breadcrumb-row"> <div class="breadcrumbs"> |
| <ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"><li class="step-0" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="index.html"><span itemprop="name">Apache FreeMarker Manual</span></a></li><li class="step-1" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="app.html"><span itemprop="name">Appendixes</span></a></li><li class="step-2" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="app_versions.html"><span itemprop="name">Version history</span></a></li><li class="step-3" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a class="label" itemprop="item" href="versions_2_3_20.html"><span itemprop="name">2.3.20</span></a></li></ul> </div> |
| <div class="bookmarks" title="Bookmarks"><span class="sr-only">Bookmarks:</span><ul><li><a href="alphaidx.html">Alpha. index</a></li><li><a href="gloss.html">Glossary</a></li><li><a href="dgui_template_exp.html#exp_cheatsheet">Expressions</a></li><li><a href="ref_builtins_alphaidx.html">?builtins</a></li><li><a href="ref_directive_alphaidx.html">#directives</a></li><li><a href="ref_specvar.html">.spec_vars</a></li><li><a href="app_faq.html">FAQ</a></li></ul></div></div></div> <div class="main-content site-width"> |
| <div class="content-wrapper"> |
| <div id="table-of-contents-wrapper" class="col-left"> |
| <script>var breadcrumb = ["Apache FreeMarker Manual","Appendixes","Version history","2.3.20"];</script> |
| <script src="toc.js?1707770044859"></script> |
| <script src="docgen-resources/main.min.js?1707770044859"></script> |
| </div> |
| <div class="col-right"><div class="page-content"><div class="page-title"><div class="pagers top"><a class="paging-arrow previous" href="versions_2_3_21.html"><span>Previous</span></a><a class="paging-arrow next" href="versions_2_3_19.html"><span>Next</span></a></div><div class="title-wrapper"> |
| <h1 class="content-header header-section1" id="versions_2_3_20" itemprop="headline">2.3.20</h1> |
| </div></div><div class="page-menu"> |
| <div class="page-menu-title">Page Contents</div> |
| <ul><li><a class="page-menu-link" href="#autoid_182" data-menu-target="autoid_182">Changes on the FTL side</a></li><li><a class="page-menu-link" href="#autoid_183" data-menu-target="autoid_183">Changes on the Java side</a></li><li><a class="page-menu-link" href="#autoid_184" data-menu-target="autoid_184">Other changes</a></li></ul> </div><p>Date of release: 2013-06-27</p><p>If you are IDE/tools author, <a href="#version_2_3_20_ide">note these changes</a>.</p> |
| |
| |
| |
| |
| <h2 class="content-header header-section2" id="autoid_182">Changes on the FTL side</h2> |
| |
| |
| <ul> |
| <li> |
| <p>Error message quality improvements:</p> |
| |
| <ul> |
| <li> |
| <p>Many error messages are now more helpful, especially |
| for users who are not experienced with FreeMarker. For |
| example, some of the most common user mistakes are |
| recognized and tips are shown to fix them, reducing support |
| costs or the time employees spend to figure them out.</p> |
| </li> |
| |
| <li> |
| <p>It's now ensured that the error location in the |
| template is included in the message returned by |
| <code class="inline-code">TemplateException.getMessage()</code>. The stack |
| trace always showed this information anyway, but some users |
| only see the "message", not the stack trace, |
| and that often didn't contained the location.</p> |
| </li> |
| |
| <li> |
| <p>The template language part of the stack trace is now |
| more detailed, and easier to understand. This is especially |
| helpful in applications that use a complex library of macros |
| and functions.</p> |
| </li> |
| |
| <li> |
| <p>Several smaller bugs were fixed that made the error |
| information wrong or lacking.</p> |
| </li> |
| |
| <li> |
| <p>The layout of the error messages is now more |
| consistent, and generally easier to read.</p> |
| </li> |
| </ul> |
| </li> |
| |
| <li> |
| <p>Changes regarding boolean to string conversions and |
| formatting:</p> |
| |
| <ul> |
| <li> |
| <p><code class="inline-code">?c</code> (computer-language formatting) |
| now works with booleans too, always giving |
| <code class="inline-code">"true"</code> or <code class="inline-code">"false"</code> |
| regardless of the <code class="inline-code">boolean_format</code>. This |
| way it's safe for generating JavaScript in a context where |
| human-readable text is also rendered.</p> |
| </li> |
| |
| <li> |
| <p>If the <code class="inline-code">boolean_format</code> setting is |
| set to anything but the default |
| <code class="inline-code">"true,false"</code> value, boolean values will |
| be automatically converted to string where a string value is |
| expected by the template language, instead of giving an |
| error. This helps you spare |
| those<code class="inline-code">?string</code>-s after boolean values. This |
| is the same logic as with numbers and dates, which were |
| always automatically converted to string, according the |
| corresponding format setting. Except, the provided default |
| boolean format is useless for automatic conversion (but it's |
| still there for <code class="inline-code">?string</code>, for backward |
| compatibility), hence it must be set manually. (We certainly |
| couldn't come up with a sensible default anyway, as for |
| booleans it depends too much on the application, not to |
| mention the localisation issues.)</p> |
| |
| <p>Exactly like with numbers and dates, automatic |
| conversion doesn't happen in these cases:</p> |
| |
| <ul> |
| <li> |
| <p>Comparisons, i.e., <code class="inline-code">someBoolean == |
| 'true'</code> is still an error</p> |
| </li> |
| |
| <li> |
| <p>Method calls where the declared type of the |
| parameter is <code class="inline-code">String</code> but the actual |
| value is a boolean; still an error</p> |
| </li> |
| |
| <li> |
| <p>When the boolean value is used as key in |
| <code class="inline-code"><em class="code-color">expr</em>[<em class="code-color">key</em>]</code>, |
| it's still an error (there was no automatic conversion |
| there for other types either, as numerical and string |
| keys have different meaning)</p> |
| </li> |
| |
| <li> |
| <p>The opposite direction, i.e., string to boolean |
| conversion; won't happen</p> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| |
| <li> |
| <p>New built-ins for numbers: <a href="ref_builtins_number.html#ref_builtin_abs"><code>abs</code></a>, <a href="ref_builtins_number.html#ref_builtin_is_nan"><code>is_nan</code></a>, |
| <a href="ref_builtins_number.html#ref_builtin_is_infinite"><code>is_infinite</code></a>. |
| Like <code class="inline-code">n?abs</code> will give the absolute value of |
| <code class="inline-code">n</code>.</p> |
| </li> |
| |
| <li> |
| <p>New built-in for sequences: <a href="ref_builtins_sequence.html#ref_builtin_join"><code>join</code></a>. Like |
| <code class="inline-code">[1, 2, 3]?join(", ")</code> will give the string |
| <code class="inline-code">"1, 2, 3"</code>.</p> |
| </li> |
| |
| <li> |
| <p>If you set the |
| <code class="inline-code">incompatible_improvements</code> setting (see <a href="https://freemarker.apache.org/docs/api/freemarker/template/Configuration.html#setIncompatibleImprovements%28freemarker.core.Version%29">here</a>) |
| to <code class="inline-code">2.3.20</code> or higher, <code class="inline-code">?html</code> |
| will escape apostrophe-quotes just like |
| <code class="inline-code">?xhtml</code> does. Utilizing this is highly |
| recommended, because otherwise if interpolations are used inside |
| attribute values that use apostrophe-quotation (<code class="inline-code"><foo |
| bar='${val}'></code>) instead of plain quotation mark |
| (<code class="inline-code"><foo bar="${val}"></code>), they might |
| produce HTML/XML that's not well-formed. Note that |
| <code class="inline-code">?html</code> didn't do this because long ago there |
| was no cross-browser way of doing this, but it's not a real |
| concern anymore. Also note that this will be the default |
| behavior starting from 2.4.</p> |
| </li> |
| |
| <li> |
| <p>Bug fix [<a href="https://sourceforge.net/p/freemarker/bugs/390/">390</a>] |
| (and other improvements): <code class="inline-code">?js_string</code> and |
| <code class="inline-code">?json_string</code> didn't escape the |
| <code class="inline-code">u2028</code>-<code class="inline-code">u2029</code> line |
| terminators (problem for JavaScript) and the |
| <code class="inline-code">u007F</code>-<code class="inline-code">u009F</code> control |
| characters (maybe a problem in JSON, depending on |
| implementation). Furthermore, the escaping of |
| <code class="inline-code">\</code>, <code class="inline-code"><</code>, and |
| <code class="inline-code">></code> become safer in that now they are |
| escaped whenever it can't be guaranteed that they won't be part |
| of <code class="inline-code"><!</code>, <code class="inline-code">]]></code> or |
| <code class="inline-code"></</code>. Earlier they were only escaped when it |
| was known that they are part of these patterns, thus it was |
| possible to assemble these patterns from two adjacent |
| interpolations. Additionally, from now on |
| <code class="inline-code"><?</code> and <code class="inline-code">--></code> also |
| count as dangerous patterns, and will trigger |
| <code class="inline-code"><</code> and <code class="inline-code">></code> |
| escaping.</p> |
| </li> |
| |
| <li> |
| <p>Bug fixed: The following string built-ins didn't coerce |
| the numerical, date (and now the boolean) left-values to string, |
| instead they threw a type error: contains, |
| <code class="inline-code">index_of</code>, <code class="inline-code">last_index_of</code>, |
| <code class="inline-code">left_pad</code>, <code class="inline-code">right_pad</code>, |
| <code class="inline-code">matches</code>, <code class="inline-code">replace</code>, |
| <code class="inline-code">split</code>, <code class="inline-code">new</code>. The other |
| string built-ins already did this conversion for a long time; |
| this was an accidental inconsistency.</p> |
| </li> |
| |
| <li> |
| <p>Bug fixed: With the default arithmetic engine, it's now |
| supported to compare infinite (positive or negative) with 0, to |
| decide its sign.</p> |
| </li> |
| </ul> |
| |
| |
| |
| |
| |
| <h2 class="content-header header-section2" id="autoid_183">Changes on the Java side</h2> |
| |
| |
| <ul> |
| <li> |
| <p><code class="inline-code">BeansWrapper</code> introspection cache |
| improvements:</p> |
| |
| <ul> |
| <li> |
| <p>Added public API to <code class="inline-code">BeansWrapper</code> |
| for clearing the class cache: |
| <code class="inline-code">clearClassIntrospecitonCache()</code>, |
| <code class="inline-code">removeFromClassIntrospectionCache(Class)</code></p> |
| </li> |
| |
| <li> |
| <p>Significantly improved multi-core performance:</p> |
| |
| <ul> |
| <li> |
| <p>Uses <code class="inline-code">ConcurrentHashMap</code> when |
| running on Java 5 or later.</p> |
| </li> |
| |
| <li> |
| <p>The cache won't block readers while introspecting |
| a class after a cache miss</p> |
| </li> |
| |
| <li> |
| <p>If multiple threads need to introspect the same |
| class that's not in the cache yet, only one of them will |
| do it, the others will wait for its results.</p> |
| </li> |
| </ul> |
| </li> |
| |
| <li> |
| <p>Bug fix [<a href="https://sourceforge.net/p/freemarker/bugs/361/">361</a>]: |
| There was a small chance of deadlock when class-reloading |
| was detected. Locking was redesigned to prevent such |
| oversights in the future.</p> |
| </li> |
| |
| <li> |
| <p>The internal package-visible |
| <code class="inline-code">freemarker.ext.beans</code> API was slightly |
| changed as the result of internal cleanup. Nobody but the |
| FreeMarker developers should define classes in that package, |
| so it shouldn't break anything. But if somebody did some |
| in-house hacks there, re-compile to see if it still |
| works.</p> |
| </li> |
| </ul> |
| </li> |
| |
| <li> |
| <p>Nameless templates (those directly created with |
| <code class="inline-code">new Template(null, |
| <em class="code-color">...</em>)</code> instead of loaded |
| through <code class="inline-code">Configuration</code>) couldn't include or |
| import other templates, and thrown a |
| <code class="inline-code">NullPointerException</code> when they tried to. Now |
| they resolve relative paths as if they were in the template root |
| directory.</p> |
| </li> |
| |
| <li> |
| <p>Bug fix: Regular expression built-ins and some logger |
| libraries (most importantly Log4J) were unavailable on the |
| Google App Engine platform. This fix is only present in the |
| GAE-compatible build, 2.3.20-gae.</p> |
| </li> |
| |
| <li> |
| <p>Added new method to <code class="inline-code">Configuration</code>: |
| <code class="inline-code">CacheStorage getCacheStorage()</code></p> |
| </li> |
| |
| <li> |
| <p>Added new methods to <code class="inline-code">Environment</code> to |
| make comparisons among <code class="inline-code">TemplateModel</code>-s |
| according the rules of the template language operators: |
| <code class="inline-code">applyEqualsOperator</code>, |
| <code class="inline-code">applyEqualsOperatorLenient</code>, |
| <code class="inline-code">applyLessThanOperator</code>, |
| <code class="inline-code">applyLessThanOrEqualsOperator</code>, |
| <code class="inline-code">applyGreaterThanOperator</code>, |
| <code class="inline-code">applyWithGreaterThanOrEqualsOperator</code></p> |
| </li> |
| |
| <li> |
| <p>Added new method, |
| <code class="inline-code">Environment.isInAttemptBlock()</code> to check if we |
| are within an <code class="inline-code">#attempt</code> block. This can be |
| useful for <code class="inline-code">TemplateExceptionHandler</code>-s, as |
| then they don't need to print the error to the output since |
| <code class="inline-code">#attempt</code> will roll it back anyway. This is |
| already utilized by the built-in |
| <code class="inline-code">TemplateExceptionHandler</code>-s |
| (<code class="inline-code">DEBUG_HANDLER</code> and |
| <code class="inline-code">HTML_DEBUG_HANDLER</code>).</p> |
| </li> |
| |
| <li> |
| <p>Added convenience constructor <code class="inline-code">Template(String |
| name, String sourceCode, Configuration cfg)</code>.</p> |
| </li> |
| |
| <li> |
| <p><code class="inline-code">TemplateException</code>-s and |
| <code class="inline-code">TemplateModelExcepton</code>-s now can have |
| <code class="inline-code">Throwable</code> cause, not just |
| <code class="inline-code">Exception</code> (it was an old oversight that |
| somehow wasn't fixed so far).</p> |
| </li> |
| |
| <li> |
| <p>Parsing error messages under the JBoss Tools FreeMarker |
| IDE now doesn't contain the usual location line, so that the |
| actual error description is immediately visible in the Eclipse |
| "Problems" view. (It's a "hack" in |
| FreeMarler itself; it tries to detect if it runs under the |
| plugin and then changes its behavior.)</p> |
| </li> |
| |
| <li> |
| <p><a name="version_2_3_20_ide"></a>Mostly concerning tool (like IDE plugin) authors:</p> |
| |
| <ul> |
| <li> |
| <p>The error message formats (what |
| <code class="inline-code">Throwable.getMessage()</code> returns) were |
| heavily changed for <code class="inline-code">TemplateException</code>-s, |
| and somewhat for <code class="inline-code">ParseException</code>-s. It's |
| unlikely that anybody depends on these, but if you tried to |
| parse these messages, be aware of this.</p> |
| </li> |
| |
| <li> |
| <p>Fixed bug where <code class="inline-code">ParseException</code> has |
| contained 0 as line and column number for lexical errors. |
| Now it contains the correct information.</p> |
| </li> |
| |
| <li> |
| <p>Added |
| <code class="inline-code">ParseException.getEditorMessage()</code>: As in |
| IDE-s the error markers show the error location to the user |
| already, the location should not be repeated in the error |
| message. So in IDE-s you should use this method instead of |
| <code class="inline-code">getMessage()</code>. (Under JBoss Tools: |
| FreeMarker now <em>tries</em> to detect that it |
| runs under the plugin, and then it already does this, except |
| that it still shows the column number as that's missing from |
| the error marker location.)</p> |
| </li> |
| |
| <li> |
| <p>Added |
| <code class="inline-code">ParseException.getTemplateName()</code></p> |
| </li> |
| |
| <li> |
| <p>Added |
| <code class="inline-code">Configuration.getSupportedBuiltInNames()</code>. |
| As new built-ins |
| (<code class="inline-code"><em class="code-color">expr</em>?<em class="code-color">builtin_name</em></code>) |
| are very often added to new FreeMarker versions, |
| auto-completion or syntax highlighting should use this set |
| instead of a fixed set of a names.</p> |
| </li> |
| |
| <li> |
| <p>The format returned by |
| <code class="inline-code">TemplateElement.getDescription()</code> was |
| heavily changed. It's what FTL stack traces and maybe some |
| outline views (tree-views) show. It was always for human |
| reading (and till now was too inconsistent for anything |
| else), so it's unlikely that this breaks anything.</p> |
| </li> |
| |
| <li> |
| <p>There were some smaller changes in |
| <code class="inline-code">freemarker.debug</code>, and it's expected that |
| there will be more, so it was marked as experimental. As far |
| as we know, nobody used it, so it shouldn't break |
| anything.</p> |
| </li> |
| </ul> |
| </li> |
| |
| <li> |
| <p>In <em>experimental status only</em>, but |
| <code class="inline-code">freemarker.jar</code> is now an OSGi bundle (see |
| <code class="inline-code">freemarker.jar/META-INF/MANIFEST.MF</code>). |
| Depending on user feedback, the bundle description may change in |
| the future. So please give feedback, especially if you are an |
| OSGi expert!</p> |
| </li> |
| |
| <li> |
| <p>Improved the HTML generated by |
| <code class="inline-code">HTML_DEBUG_HANDLER</code> (the |
| red-on-yellow-background error message). Most importantly, now |
| it will word-wrap. Other changes are minor, like now it can |
| break out of CDATA sections, or now it has less intense |
| colors.</p> |
| </li> |
| |
| <li> |
| <p>New <code class="inline-code">Template</code> method, |
| <code class="inline-code">getActualTagSyntax()</code>: Tells if the template |
| is using traditional or square-bracket syntax. As the syntax can |
| be overridden in the template, also it's possibly decided by |
| auto-detection, it wasn't trivial to it tell till now.</p> |
| </li> |
| |
| <li> |
| <p>Added some utility methods that are useful for generating |
| error messages in custom directives: |
| <code class="inline-code">ClassUtil.getFTLTypeDescription(TemplateModel)</code>, |
| <code class="inline-code">getShortClassName</code>, |
| <code class="inline-code">getShortClassNameOfObject</code></p> |
| </li> |
| |
| <li> |
| <p>Bug fix [<a href="https://sourceforge.net/p/freemarker/bugs/364/">364</a>]: |
| <code class="inline-code">freemarker.template.EmptyMap</code> (which is passed |
| to <code class="inline-code">TemplateDirectiveModel</code>-s if there are no |
| parameters) now allows <code class="inline-code">remove(key)</code>, |
| <code class="inline-code">clear()</code> and |
| <code class="inline-code">putAll(anyEmptyMap)</code> as these do nothing |
| anyway.</p> |
| </li> |
| |
| <li> |
| <p>Bug fix [<a href="https://sourceforge.net/p/freemarker/bugs/375/">375</a>]: |
| <code class="inline-code">NullPointerException</code> on IBM J9 VM (not on the |
| Sun/Oracle implementation) in <code class="inline-code">BeansWrapper</code> |
| when the Java implementation legally returns |
| <code class="inline-code">null</code> for some <code class="inline-code">BeanInfo</code> |
| getters.</p> |
| </li> |
| |
| <li> |
| <p>Bug fix: Cloning a <code class="inline-code">Configuration</code> didn't |
| deep-clone the data structures storing the |
| <code class="inline-code">auto_imports</code> and |
| <code class="inline-code">auto_includes</code> settings, hence possibly |
| leading to aliasing problems.</p> |
| </li> |
| |
| <li> |
| <p>Bug fix [<a href="https://sourceforge.net/p/freemarker/bugs/377/">377</a>]: |
| After a failed method call the exception handler could fail in |
| the rare occasion when |
| <code class="inline-code">targetObject.toString()</code> fails, raising a |
| runtime exception that not even the <code class="inline-code">attempt</code> |
| directive will catch.</p> |
| </li> |
| |
| <li> |
| <p>Bug fix [<a href="https://sourceforge.net/p/freemarker/bugs/391/">391</a>]: |
| If a template name has contained <code class="inline-code">*</code> that was |
| not the only character in the path step, it threw |
| <code class="inline-code">NegativeArraySizeException</code> instead of |
| <code class="inline-code">FileNotFoundException</code>.</p> |
| </li> |
| |
| <li> |
| <p>With the default arithmetic engine, performance |
| optimizations of comparison operations when some of the numbers |
| is 0, and when the sign of the numbers differ.</p> |
| </li> |
| |
| <li> |
| <p>Some smaller fixes in |
| <code class="inline-code">TemplateElement.getCanonicalForm()</code>, also some |
| quality improvements there.</p> |
| </li> |
| |
| <li> |
| <p>Bug fixes in <code class="inline-code">classic_compatible</code> mode |
| (this mode is to help migrating from FreeMarker 1), thanks to |
| Information Mosaic:</p> |
| |
| <ul> |
| <li> |
| <p>When a macro was called with a |
| <code class="inline-code">null</code>/missing parameter value, it has |
| caused error like in FreeMarker 2.3</p> |
| </li> |
| |
| <li> |
| <p>When a hash literal contained reference to a |
| <code class="inline-code">null</code>/missing variable, like in <code class="inline-code">{ |
| 'a': missingVar }</code>, it has caused an error like in |
| 2.3</p> |
| </li> |
| |
| <li> |
| <p>When a sequence literal contained reference to a |
| <code class="inline-code">null</code>/missing variable, like in |
| <code class="inline-code">[1, missingVar]</code>, it has caused an error |
| like in 2.3</p> |
| </li> |
| |
| <li> |
| <p>When a the left-side of the <code class="inline-code">.</code> (dot) |
| or <code class="inline-code">[<em class="code-color">key</em>]</code> |
| operator was <code class="inline-code">null</code> or missing variable, |
| like in <code class="inline-code">missingVar.subVar</code>, it has caused |
| an error like in 2.3</p> |
| </li> |
| |
| <li> |
| <p>When <code class="inline-code">BeanModel</code>-s are tried to be |
| treated as strings, for most subclasses it has failed with |
| type error, like in 2.3. In FreeMarker 1 all |
| <code class="inline-code">BeanModel</code>-s were |
| <code class="inline-code">TemplateScalarModel</code>-s, so it should |
| succeed. The fix for this only works where FreeMarker |
| <em>coerces</em> to string (string built-ins on |
| the left-side and concatenation (<code class="inline-code">+</code>) and |
| interpolation |
| (<code class="inline-code">${<em class="code-color">...</em>}</code>) do |
| that), otherwise unfortunately it will still fail.</p> |
| </li> |
| |
| <li> |
| <p>The <code class="inline-code">classic_compatible</code> setting now |
| accepts value <code class="inline-code">2</code> along |
| <code class="inline-code">true</code> (alias <code class="inline-code">1</code>) and |
| <code class="inline-code">false</code> (alias <code class="inline-code">0</code>). |
| <code class="inline-code">2</code> means <code class="inline-code">true</code> but with |
| emulating bugs in early 2.x classic-compatibility mode. |
| Currently this only affects how booleans are converted to |
| string; with <code class="inline-code">1</code> it's always |
| <code class="inline-code">"true"</code>/<code class="inline-code">""</code>, but with |
| <code class="inline-code">2</code> it's <code class="inline-code">"true"/"false"</code> |
| for values wrapped by <code class="inline-code">BeansWrapper</code> as |
| then <code class="inline-code">Boolean.toString()</code> prevails. Note |
| that |
| <code class="inline-code"><em class="code-color">someBoolean</em>?string</code> |
| will always consistently format the boolean according the |
| <code class="inline-code">boolean_format</code> setting, just like in |
| FreeMarker 2.3.</p> |
| </li> |
| </ul> |
| </li> |
| |
| <li> |
| <p>Bug fix [<a href="https://sourceforge.net/p/freemarker/bugs/394/">394</a>]: |
| When trying to access the optional Jython (or W3C DOM) classes |
| has failed in <code class="inline-code">DefaultObjectWrapper</code> with an |
| <code class="inline-code">Error</code>, rather than with an |
| <code class="inline-code">Exception</code>, loading the |
| <code class="inline-code">DefaultObjectWrapper</code> class itself has failed, |
| instead of the Jython (or W3C DOM) support being disabled. From |
| now in, it will survive any kind of <code class="inline-code">Throwable</code> |
| there, and if the <code class="inline-code">Throwable</code> is not an |
| <code class="inline-code">ClassNotFoundException</code>, it will also log the |
| <code class="inline-code">Throwable</code>.</p> |
| </li> |
| |
| <li> |
| <p>Improved the performance of |
| <code class="inline-code">(thisVarIsMissing.foo)!default</code> and similar |
| <em>parenthetical</em> existence operators and |
| existence built-ins in the case when the |
| <code class="inline-code">null</code>/missing variable is not the last step |
| inside the parenthesis. In that case it's about 30 times faster |
| now, measured on Java 6. In other cases (when all variables |
| exists, or the the last step is missing) the performance is |
| about the same (relatively fast) as before.</p> |
| </li> |
| |
| <li> |
| <p>Added interface |
| <code class="inline-code">freemarker.cache.CacheStorageWithGetSize</code> |
| which allows querying the current number of cache entries in a |
| <code class="inline-code">CacheStorage</code> that implements it. It's |
| implemented by all out-of-the-box |
| <code class="inline-code">CacheStorage</code> implementations. Also added |
| <code class="inline-code">getStrongSize()</code> and |
| <code class="inline-code">getSoftSize()</code> to |
| <code class="inline-code">MRUCacheStorage</code>.</p> |
| </li> |
| |
| <li> |
| <p>Version and build information changes:</p> |
| |
| <ul> |
| <li> |
| <p>The form of the nightly build version numbers has |
| changed to be Maven/JSR 277 compliant. What earlier was |
| <code class="inline-code">2.3.19mod</code> is now something like |
| <code class="inline-code">2.3.20-nightly_20130605T130506Z</code> (note how |
| the last points to the target release version instead of the |
| last release version).</p> |
| </li> |
| |
| <li> |
| <p>The form of the Release Candidate and Preview version |
| numbers where changed to be Maven/JSP 277 compliant: |
| <code class="inline-code">2.4pre2</code> is now |
| <code class="inline-code">2.4.0-pre02</code>, <code class="inline-code">2.4rc1</code> is |
| now <code class="inline-code">2.4.0-rc01</code>.</p> |
| </li> |
| |
| <li> |
| <p>Added new static method to |
| <code class="inline-code">Configuration</code> to query build date: |
| <code class="inline-code">getBuildDate()</code>. This is also printed by |
| the main command line class.</p> |
| </li> |
| </ul> |
| </li> |
| |
| <li> |
| <p>Various internal code cleanups.</p> |
| </li> |
| </ul> |
| |
| |
| |
| |
| |
| <h2 class="content-header header-section2" id="autoid_184">Other changes</h2> |
| |
| |
| <ul> |
| <li> |
| <p>Many JavaDoc improvements, mostly in the documentation of |
| the basic (most frequently used) classes.</p> |
| </li> |
| |
| <li> |
| <p>FreeMarker source code has moved to GitHub (<a href="???">https://github.com/freemarker/freemarker</a>), |
| other project resources has remained on sourceforge.net.</p> |
| </li> |
| |
| <li> |
| <p>Project structure cleanup, Ivy-based build script.</p> |
| </li> |
| </ul> |
| <div class="bottom-pagers-wrapper"><div class="pagers bottom"><a class="paging-arrow previous" href="versions_2_3_21.html"><span>Previous</span></a><a class="paging-arrow next" href="versions_2_3_19.html"><span>Next</span></a></div></div></div></div> </div> |
| </div> |
| <div class="site-footer"><div class="site-width"><div class="footer-top"><div class="col-left sitemap"><div class="column"><h3 class="column-header">Overview</h3><ul><li><a href="https://freemarker.apache.org/">What is FreeMarker?</a></li><li><a href="https://freemarker.apache.org/freemarkerdownload.html">Download</a></li><li><a href="app_versions.html">Version history</a></li><li><a href="app_faq.html">FAQ</a></li><li><a itemprop="license" href="app_license.html">License</a></li><li><a href="https://privacy.apache.org/policies/privacy-policy-public.html">Privacy policy</a></li></ul></div><div class="column"><h3 class="column-header">Often used / Reference</h3><ul><li><a href="https://try.freemarker.apache.org/">Try template online</a></li><li><a href="dgui_template_exp.html#exp_cheatsheet">Expressions cheatsheet</a></li><li><a href="ref_directive_alphaidx.html">#directives</a></li><li><a href="ref_builtins_alphaidx.html">?built_ins</a></li><li><a href="ref_specvar.html">.special_vars</a></li><li><a href="api/freemarker/core/Configurable.html#setSetting-java.lang.String-java.lang.String-">Configuration settings</a></li></ul></div><div class="column"><h3 class="column-header">Community</h3><ul><li><a href="https://github.com/apache/freemarker">Github project page</a></li><li><a href="https://issues.apache.org/jira/projects/FREEMARKER">Report a bug</a></li><li><a href="https://freemarker.apache.org/report-security-vulnerabilities.html">Report security vulnerability</a></li><li><a href="https://stackoverflow.com/questions/ask?tags=freemarker">Get help on StackOverflow</a></li><li><a href="https://twitter.com/freemarker">Announcements on Twitter</a></li><li><a href="https://freemarker.apache.org/mailing-lists.html">Discuss on mailing lists</a></li></ul></div></div><div class="col-right"><ul class="social-icons"><li><a class="github" href="https://github.com/apache/freemarker">Github</a></li><li><a class="twitter" href="https://twitter.com/freemarker">Twitter</a></li><li><a class="stack-overflow" href="https://stackoverflow.com/questions/ask?tags=freemarker">Stack Overflow</a></li></ul><a class="xxe" href="http://www.xmlmind.com/xmleditor/" rel="nofollow" title="Edited with XMLMind XML Editor"><span>Edited with XMLMind XML Editor</span></a></div></div><div class="footer-bottom"> <p class="last-generated"> |
| Last generated: |
| <time itemprop="dateModified" datetime="2024-02-12T20:34:04Z" title="Monday, February 12, 2024 at 8:34:04 PM Greenwich Mean Time">2024-02-12 20:34:04 GMT</time>, for Freemarker 2.3.32 </p> |
| <p class="copyright"> |
| © <span itemprop="copyrightYear">1999</span>–2024 |
| <a itemtype="http://schema.org/Organization" itemprop="copyrightHolder" href="https://apache.org/">The Apache Software Foundation</a>. Apache FreeMarker, FreeMarker, Apache Incubator, Apache, the Apache FreeMarker logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners. </p> |
| </div></div></div></body> |
| </html> |