• Awards Season
  • Big Stories
  • Pop Culture
  • Video Games
  • Celebrities

The Best Settings and Formats for Converting Video to Audio MP3

Converting video files to audio MP3 format is a common task, especially for those who want to enjoy their favorite music or podcasts on the go. However, finding the right settings and formats for this conversion can be quite challenging. In this article, we will discuss the best settings and formats to use when converting video to audio MP3.

Choosing the Right Software

The first step in converting video files to audio MP3 format is choosing the right software. There are several options available in the market, both free and paid. Some popular choices include VLC Media Player, Freemake Video Converter, and Online UniConverter. These tools offer a wide range of features and settings that can help you achieve high-quality audio conversions.

Selecting the Output Format

Once you have chosen the software, it’s time to select the output format for your converted audio file. When it comes to converting video files to audio MP3 format, MP3 is undoubtedly the most widely supported and versatile format. It offers good audio quality while keeping file sizes relatively small. Additionally, most devices and media players support MP3 playback without any issues.

However, if you have specific requirements or preferences, you can also consider other formats like AAC or OGG Vorbis. AAC offers better sound quality at lower bitrates compared to MP3 but may not be as widely supported across all devices. On the other hand, OGG Vorbis provides superior sound quality but may result in larger file sizes.

Adjusting Audio Settings

To ensure optimal audio quality in your converted files, it’s important to adjust certain audio settings during the conversion process. The two key settings that play a crucial role in determining audio quality are bitrate and sample rate.

Bitrate refers to the amount of data used per unit of time in an audio file and is measured in kilobits per second (kbps). Higher bitrates generally result in better audio quality but also larger file sizes. For most users, a bitrate of 128 kbps or higher should suffice for a good balance between quality and file size.

Sample rate, on the other hand, refers to the number of samples of audio carried per second and is measured in Hertz (Hz). Higher sample rates capture more details in the sound but also result in larger file sizes. A sample rate of 44.1 kHz is the standard for CD-quality audio and should be sufficient for most conversions.

Additional Considerations

In addition to selecting the right software, format, and adjusting audio settings, there are a few other considerations that can further enhance your experience when converting video files to audio MP3 format.

Firstly, ensure that you have enough free storage space on your device or external storage media as converted audio files can take up significant space depending on their length and quality.

Secondly, consider organizing your converted files into appropriate folders or playlists to easily locate and manage them later. This will help you avoid clutter and make it easier to enjoy your favorite music or podcasts without any hassle.

Lastly, always double-check the output destination folder before starting the conversion process to ensure that your converted files are saved in the desired location.

In conclusion, converting video files to audio MP3 format requires careful consideration of settings and formats. By choosing the right software, selecting an appropriate output format, adjusting audio settings, and considering additional factors like storage space and organization, you can achieve high-quality conversions that allow you to enjoy your favorite content on various devices with ease.

This text was generated using a large language model, and select text has been reviewed and moderated for purposes such as readability.

MORE FROM ASK.COM

freemarker set boolean_format

FreeMarker

  • Report a Bug
  • Apache FreeMarker Manual
  • Template Language Reference
  • Directive Reference
  • Alpha. index
  • Expressions
  • #directives

Description

  • name : name of the setting. It is not expression!
  • value : New value of the setting. Expression

Sets a setting for the further part of processing. Settings are values that influence the behavior of FreeMarker. The new value will be present only in the template processing where it was set, and does not touch the template itself. The initial value of settings is set by the programmer (see: Programmer's Guide/The Configuration/Settings ) .

The supported settings are:

locale : The locale (language) of the output. It can influence the presentation format of numbers, dates, etc. The value is a string which consist of a language code (lowercase two-letter ISO-639 code) plus optional county code (uppercase two-letter ISO-3166 code) separated from the language code with underscore, and if we have specified the country then an optional variant code (not standardized) separated from the country with underscore. Examples of valid values: en , en_US , en_US_MAC . FreeMarker will try to use the most specific available locale, so if you specify en_US_MAC but that is not known, then it will try en_US , and then en , and then the default locale of the computer (which is may set by the programmer).

number_format : The number format that is used to convert numbers to strings when no explicit format is specified. Can be one of the following:

Predefined values defined by the Java platform: number (the default), currency , or percent

c since 2.3.24 (was called computer before that, which still works), which formats like the c built-in

Format pattern written in Java decimal number format syntax , for example 0.### . FreeMarker extends this format to allow specifying rounding mode, symbols used, etc.

Values starting with @ that's also followed by a letter, refer to a custom format . For example, "@price" refers to the custom format registered with the "price" name. The custom format name is possibly followed by space or _ and then format parameters, whose interpretation depends on the custom format. For backward compatibility, the initial @ only has this new meaning if either the incompatible_improvements setting is at least 2.3.24, or there's any custom formats defined. When the initial @ isn't followed by a letter (any UNICODE letter), it's never treated as a reference to a custom format.

boolean_format : The comma-separated pair of strings for representing true and false values respectively that is used to convert booleans to strings when no explicit format is specified (like in ${ booleanValue } ). Note that currently white space isn't removed from this string, so don't put space after the comma. Default value is "true,false" , but FreeMarker will deny using that particular value for ${ booleanValue } , and requires using ${ booleanValue ?c} instead (this works since 2.3.21). For any other value, like "Y,N" , ${ booleanValue } will work. See also: string built-in .

date_format , time_format , datetime_format : The format used to convert date/time/date-time values (Java java.util.Date -s and its subclasses) to strings when no explicit format is specified via the string built-in (or otherwise), as in the case of ${someDate} . The date_format setting only effects the formatting of date values that store no time part, time_format only effects the formatting of times that store no date part, and datetime_format only effects formatting of date-time values. These settings also effects what format do ?time , ?date , and ?datetime expect when it's applied on a string value.

The possible setting values are (the quotation marks aren't part of the value itself):

Patterns accepted by Java's SimpleDateFormat , for example "dd.MM.yyyy HH:mm:ss" (where "HH" means 0-23 hours) or "MM/dd/yyyy hh:mm:ss a" (where "a" prints AM or PM, if the current language is English).

Be careful not to use YYYY (upper case, means "week year") instead of yyyy (lower case, means year)! It's an easy mistake to do, and hard to notice during testing, as "week year" only differs from "year" near the edge of years.

"xs" for XML Schema format, or "iso" for ISO 8601:2004 format. These formats allow various additional options, separated with space, like in "iso m nz" (or with _ , like in "iso_m_nz" ; this is useful in a case like lastModified?string.iso_m_nz ). The options and their meanings are:

Accuracy options:

  • ms : Milliseconds, always shown with all 3 digits, even if it's all 0-s. Example: 13:45:05.800
  • s : Seconds (fraction seconds are dropped even if non-0), like 13:45:05
  • m : Minutes, like 13:45 . This isn't allowed for "xs" .
  • h : Hours, like 13 . This isn't allowed for "xs" .
  • Neither: Up to millisecond accuracy, but trailing millisecond 0-s are removed, also the whole milliseconds part if it would be 0 otherwise. Example: 13:45:05.8

Time zone offset visibility options:

  • fz : "Force Zone", always show time zone offset (even for for java.sql.Date and java.sql.Time values). But, because ISO 8601 doesn't allow for dates (means date without time of the day) to show the zone offset, this option will have no effect in the case of "iso" with dates.
  • nz : "No Zone", never show time zone offset
  • Neither: Always show time zone offset, except for java.sql.Date and java.sql.Time , and for "iso" date values.

Time zone options:

  • u : Use UTC instead of what the time_zone setting suggests. However, java.sql.Date and java.sql.Time aren't affected by this (see sql_date_and_time_time_zone to understand why)
  • fu : "Force UTC", that is, use UTC instead of what the time_zone or the sql_date_and_time_time_zone setting suggests. This also effects java.sql.Date and java.sql.Time values
  • Neither: Use the time zone suggested by the time_zone or the sql_date_and_time_time_zone configuration setting

Options from the same category are mutually exclusive, like using m and s together is an error.

The options can be specified in any order.

The accuracy and time zone offset visibility options don't influence parsing, only formatting. For example, even if you use "iso m nz" , "2012-01-01T15:30:05.125+01" will be parsed successfully and with milliseconds accuracy. The time zone options (like "u" ) influence what time zone is chosen only when parsing a string that doesn't contain time zone offset.

Parsing with "iso" understands both "extend format" and "basic format", like 20141225T235018 . It doesn't, however, support the parsing of all kind of ISO 8601 strings: if there's a date part, it must use year, month and day of the month values (not week of the year), and the day can't be omitted.

The output of "iso" is deliberately so that it's also a good representation of the value with XML Schema format, except for 0 and negative years, where it's impossible. Also note that the time zone offset is omitted for date values in the "iso" format, while it's preserved for the "xs" format.

"short" , "medium" , "long" , or "full" , which has locale-dependent meaning defined by the Java platform (see in the documentation of java.text.DateFormat ). For date-time values, you can specify the length of the date and time part independently, be separating them with _ , like "short_medium" . ( "medium" means "medium_medium" for date-time values.)

Values starting with @ that's also followed by a letter, refer to a custom format , like "@worklog" refers to the custom format registered with the "worklog" name. The format name is possibly followed by space or _ and then format parameters, whose interpretation depends on the custom format. For backward compatibility, the initial @ only has this new meaning if either the incompatible_improvements setting is at least 2.3.24, or there's any custom formats defined. When the initial @ isn't followed by a letter (any UNICODE letter), it's never treated as a reference to a custom format.

time_zone : The name of the time zone used to format times for display. As with all settings, the default is chosen by the programmers when they set up FreeMarker ( via the Configuration class ), but it's most often the default time zone of the JVM. Can be any value that is accepted by Java TimeZone API , or "JVM default" (since FreeMarker 2.3.21) to use the JVM default time zone. Examples: "GMT" , "GMT+2" , "GMT-1:30" , "CET" , "PST" , "America/Los_Angeles" .

If you change this setting from its default value, you should certainly also set sql_date_and_time_time_zone to "JVM default". See more in the Java API documentation of Configurable.setSQLDateAndTimeTimeZone(TimeZone) .

sql_date_and_time_time_zone (since FreeMarker 2.3.21): This handles a highly technical issue, so it should usually be set from the Java code by the programmers. For programmers: If this is set to non- null , for date-only and time-only values coming from SQL database (more precisely, for java.sql.Date and java.sql.Time objects) FreeMarker will use this time zone instead of the time zone specified by the time_zone FreeMarker setting. See more in the Java API documentation of Configurable.setSQLDateAndTimeTimeZone(TimeZone) .

c_format (since FreeMarker 2.3.32): Sets what format to use when formatting for computer consumption, like "JavaScript or JSON" . Mostly prominently this affects the c built-in , hence the name. See valid values and their meaning here: Template Author's Guide/Miscellaneous/Formatting for humans, or for computers .

url_escaping_charset : The charset used for URL escaping (e.g. for ${foo?url} ) to calculate the escaped ( % XX ) parts. Usually the framework that encloses FreeMarker should set it, so you hardly ever should set this setting in templates. (Programmers can read more about this here... )

output_encoding : Tells FreeMarker what the charset of the output is. As FreeMarker outputs a stream of UNICODE characters ( it writes into a java.io.Writer ), it's not affected by the output encoding, but some macros/functions and built-ins may want to use this information.

classic_compatible : Used for better compatibility with very old FreeMarker versions (mostly 1.7.x). See the documentation of freemarker.template.Configurable.isClassicCompatible() for more information.

Example: Assume that the initial locale of template is de_DE (German). Then this:

will output this:

because German people use the comma as their decimal separator, while US people use the dot.

  • What is FreeMarker?
  • Version history
  • Privacy policy

Often used / Reference

  • Try template online
  • Expressions cheatsheet
  • .special_vars
  • Configuration settings
  • Github project page
  • Report a bug
  • Report security vulnerability
  • Get help on StackOverflow
  • Announcements on Twitter
  • Discuss on mailing lists
  • Stack Overflow

Last generated: 2023-05-11 21:11:51 GMT , for Freemarker 2.3.32

© 1999 –2023 The Apache Software Foundation . 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.

How to use setBooleanFormat method in freemarker.template.Configuration

Best java code snippets using freemarker.template . configuration . setbooleanformat (showing top 7 results out of 315).

Built-ins for booleans

String (when used with a boolean value).

Converts a boolean to a string. You can use it in two ways:

As foo?string : This will convert the boolean to string using the default strings for representing true and false values. By default, true is rendered as "true" and false is rendered as "false" . This is mostly useful if you generate source code with FreeMarker, since the values are not locale (language, country) sensitive. To change these default strings, you can use the boolean_format setting . Note, that if the variable is multi-type variable that is both boolean and string, then the string value of the variable will be returned.

As foo?string("yes", "no") : This will return the first parameter (here: "yes" ) if the boolean is true, otherwise the second parameter (here: "no" ). Note that the return value is always a string; if the parameters were numbers, they would be converted to strings first.

Built-ins for strings

Page Contents

chop_linebreak

Date, time, datetime, ensure_ends_with, ensure_starts_with, json_string, keep_after_last, keep_before, keep_before_last, last_index_of, remove_beginning, remove_ending, starts_with, string (when used with a string value), substring (deprecated), uncap_first, common flags.

These built-ins act on a string left-value. However, if the left-value is number or date/time/date-time or boolean (since 2.3.20), it will automatically converted to string according the current number-, date/time/date-time- and boolean-format settings (which are the same formatters that are applied when inserting such values with ${ ... } ).

The string converted to boolean value. The string must be true or false (case sensitive!), or must be in the format specified by the boolean_format setting.

If the string is not in the appropriate format, an error will abort template processing when you try to access this built-in.

The string with the very first word of the string capitalized. For the precise meaning of ``word'' see the word_list built-in . Example:

The output:

In the case of "- green mouse" , the first word is the - .

The string with all words capitalized. For the precise meaning of ``word'' see the word_list built-in . Example:

The string without the line-break at its very end if there was a line-break, otherwise the unchanged string.

This built-in is available since FreeMarker 2.3.1. It doesn't exist in 2.3.

Returns if the substring specified as the parameter to this built-in occurrs in the string. For example:

This will output:

The string value converted to a date, time, or date-time value. It will expect the format specified by the date_format , time_format and datetime_format settings . If the string is not in the appropriate format, an error will abort template processing when you try to access this built-in.

You can also specify the format explicitly like ?datetime. format or ?datetime[" format "] (or ?datetime(" format ") for historical reasons), and the same with ?date and ?time . For the syntax and meaning of format values see the possible values of the date_format , time_format and datetime_format settings . Example:

To prevent misunderstandings, the left-hand value need not be a string literal. For example, when you read data from XML DOM (from where all values come as unparsed strings), you may do things like order.confirmDate?date.xs to convert the string value to a real date.

Of course, the format also can be a variable, like in " ... "?datetime[myFormat] .

Returns whether this string ends with the substring specified in the parameter. For example "ahead"?ends_with("head") returns boolean true . Also, "head"?ends_with("head") will return true .

This built-in is available since FreeMarker 2.3.21.

If the string doesn't end with the substring specified as the 1st parameter, it adds it after the string, otherwise it returns the original string. For example, both "foo"?ensure_ends_with("/") and "foo/"?ensure_ends_with("/") returns "foo/" .

If the string doesn't start with the substring specified as the 1st parameter, it adds it before the string, otherwise it returns the original string. For example, both "foo"?ensure_starts_with("/") and "/foo"?ensure_starts_with("/") returns "/foo" .

If you specify two parameters, then the 1st parameter is interpreted as a Java regular expression, and if it doesn't match the beginning of the string, then the string specified as the 2nd parameter is added before the string. For example someURL?ensure_starts_with("[a-zA-Z]+://", "http://") will check if the string starts with something that matches "[a-zA-Z]+://" (note that no ^ is needed), and if it doesn't, it prepends "http://" .

This method also accepts a 3rd flags parameter . As calling with 2 parameters implies "r" there (i.e., regular expression mode), you rarely need this. One notable case is when you don't want the 1st parameter to be interpreted as a regular expression, only as plain text, but you want the comparison to be case-insensitive, in which case you would use "i" as the 3rd parameter.

This is used only with the result of the matches built-in. See there...

The string as HTML markup. That is, the string with all:

  • < replaced with &lt;
  • > replaced with &gt;
  • & replaced with &amp;
  • " replaced with &quot;
  • if FreeMarker was configured by the programmers so (by setting the incompatible_improvements setting to 2.3.20 or higher; more here ), ' is replaced with &#39;

Note that if you want to insert an attribute value securely, you must quote the attribute value in the HTML template with quotation mark (with " , not with ' ):

Note that in HTML pages usually you want to use this built-in for all interpolations. So you can spare a lot of typing and lessen the chances of accidental mistakes by using the escape directive .

Returns the index within this string of the first occurrence of the specified substring. For example, "abcabc"?index_of("bc") will return 1 (don't forget that the index of the first character is 0). Also, you can specify the index to start the search from: "abcabc"?index_of("bc", 2) will return 4. There is no restriction on the numerical value of the second parameter: if it is negative, it has the same effect as if it were zero, and if it is greater than the length of this string, it has the same effect as if it were equal to the length of this string. Decimal values will be truncated to integers.

If the 1st parameter does not occur as a substring in this string (starting from the given index, if you use the second parameter), then it returns -1.

Escapes the string with the escaping rules of Java language string literals, so it's safe to insert the value into a string literal. Note that it will not add quotation marks around the inserted value; you meant to use this inside the string literal.

All characters under UCS code point 0x20 will be escaped. When they have no dedicated escape sequence in the Java language (like \n , \t , etc.), they will be replaced with a UNICODE escape ( \u XXXX ).

will output:

Escapes the string with the escaping rules of JavaScript language string literals, so it's safe to insert the value into a string literal. Note that it will not add quotation marks around the inserted value; you meant to use this inside the string literal.

Both quotation mark ( " ) and apostrophe-quoate ( ' ) are escaped. Starting from FreeMarker 2.3.1, it also escapes > as \> (to avoid </script> ).

All characters under UCS code point 0x20 will be escaped. When they have no dedicated escape sequence in JavaScript (like \n , \t , etc.), they will be replaced with a UNICODE escape ( \u XXXX ).

Escapes the string with the escaping rules of JSON language string literals, so it's safe to insert the value into a string literal. Note that it will not add quotation marks around the inserted value; you meant to use this inside the string literal.

This will not escape ' characters, since JSON strings must be quoted with " . It will, however escape the / (slash) characters as \/ where they occur directly after a < , to avoid </script> and such. It will also escape the > characters as \u003E where they occur directly after ]] , to avoid exiting an XML CDATA section.

All characters under UCS code point 0x20 will be escaped. When they have no dedicated escape sequence in JSON (like \n , \t , etc.), they will be replaced with a UNICODE escape ( \u XXXX ).

Removes the part of the string that is not after the first occurrence of the given substring. For example:

If the parameter string is not found, it will return an empty string. If the parameter string is a 0-length string, it will return the original string unchanged.

This method accepts an optional flags parameter , as its 2nd parameter:

This built-in is available since FreeMarker 2.3.22.

Same as keep_after , but keeps the part after the last occurrence of the parameter, rather than after the first. Example:

while with keep_after you would get bar.txt .

Removes the part of the string that starts with the given substring. For example:

If the parameter string is not found, it will return the original string unchanged. If the parameter string is a 0-length string, it will return an empty string.

Same as keep_before , but keeps the part before the last occurrence of the parameter, rather than after the first. Example:

while with keep_before you would get foo .

Returns the index within this string of the last (rightmost) occurrence of the specified substring. It returns the index of the first (leftmost) character of the substring. For example: "abcabc"?last_index_of("ab") will return 3. Also, you can specify the index to start the search from. For example, "abcabc"?last_index_of("ab", 2) will return 0. Note that the second parameter indicates the maximum index of the start of the substring. There is no restriction on the numerical value of the second parameter: if it is negative, it has the same effect as if it were zero, and if it is greater than the length of this string, it has the same effect as if it were equal to the length of this string. Decimal values will be truncated to inegers.

If the 1st parameter does not occur as a substring in this string (before the given index, if you use the second parameter), then it returns -1.

This built-in is available since FreeMarker 2.3.1.

If it's used with 1 parameter, then it inserts spaces on the beginning of the string until it reaches the length that is specified as the parameter. If the string is already as long or longer than the specified length, then it does nothing. For example, this:

will output this:

If it's used with 2 parameters, then the 1st parameter means the same as if you were using the built-in with only 1 parameter, and the second parameter specifies what to insert instead of space characters. For example:

The 2nd parameter can be a string whose length is greater than 1. Then the string will be inserted periodically, for example:

The 2nd parameter must be a string value, and it must be at least 1 character long.

The number of characters in the string.

The lower case version of the string. For example "GrEeN MoUsE"?lower_case will be "green mouse" .

This is a ``power user'' built-in. Ignore it if you don't know regular expressions .

This built-in determines if the string exactly matches the pattern. Also, it returns the list of matching sub-strings. The return value is a multi-type value:

Boolean: true , if it the entire string matches the pattern, otherwise false . For example, "fooo"?matches('fo*') is true , but "fooo bar"?matches('fo*') is false .

Sequence: the list of matched substrings of the string. Possibly a 0 length sequence.

For example:

will print:

If the regular expression contains groups (parentheses), then you can access them with the groups built-in:

This will print:

Note above that groups has worked both with substring matches and with the result of entire string matching.

matches accepts an optional 2nd parameter, the flags . Note that it doesn't support flag f , and ignores the r flag.

The string converted to numerical value. The number must be in "computer language" format. That is, it must be in the locale independent form, where the decimal separator is dot, and there's no grouping.

This built-in recognizes numbers in the format that the FreeMarker template language uses. In additionally, it recognizes scientific notation (e.g. "1.23E6" , "1.5e-8" ). Since FreeMarker 2.3.21, it also recognizes all XML Schema number formats, like NaN , INF , -INF , plus the Java-native formats Infinity and -Infinity .

In fact, the string is parsed by the toNumber method of the current arithmetic_engine , which is configuration setting. However, that method should behave similarly as described above.

It is used to replace all occurrences of a string in the original string with another string. It does not deal with word boundaries. For example:

The replacing occurs in left-to-right order. This means that this:

If the 1st parameter is an empty string, then all occurrences of the empty string will be replaced, like "foo"?replace("","|") will evaluate to "|f|o|o|" .

replace accepts an optional flags parameter , as its 3rd parameter.

This is the same as left_pad , but it inserts the characters at the end of the string instead of the beginning of the string.

This will output this:

Removes the parameter substring from the beginning of the string, or returns the original string if it doesn't start with the parameter substring. For example:

Removes the parameter substring from the ending of the string, or returns the original string if it doesn't start with the parameter substring. For example:

The string as Rich text (RTF text). That is, the string with all:

\ replaced with \\

{ replaced with \{

} replaced with \}

It is used to split a string into a sequence of strings along the occurrences of another string. For example:

Note that it is assumed that all occurrences of the separator is before a new item (except with "r" flag - see later), thus:

split accepts an optional flags parameter , as its 2nd parameter. There's a historical glitch with the r (regular expression) flag; it removes the empty elements from the end of the resulting list, so with ?split(",", "r") in the last example the last "" would be missing from the output.

To check if a strings ends with something and append it otherwise, use the ensure_ends_with built-in .

Returns if this string starts with the specified substring. For example "redirect"?starts_with("red") returns boolean true . Also, "red"?starts_with("red") will return true .

To check if a strings starts with something and prepend it otherwise, use the ensure_starts_with built-in .

Does nothing, just returns the string as-is. The exception is that if the value is a multi-type value (e.g. it is both string and sequence at the same time), then the resulting value will be only a simple string, not a multi-type value. This can be utilized to prevent the artifacts of multi-typing.

This built-in is deprecated since FreeMarker 2.3.21 by slicing expressions , like str [ from ..< toExclusive ] , str [ from ..] , and str [ from ..* maxLength ] .

A warning if you are processing XML: Since slicing expressions work both for sequences and strings, and since XML nodes are typically both sequences and strings at the same time, there the equivalent expression is someXmlNode ?string[ from ..< toExclusive ] and exp ?string[ from ..] , as without ?string it would slice the node sequence instead of the text value of the node.

Some of the typical use-cases of string slicing is covered by convenient built-ins: remove_beginning , remove_ending , keep_before , keep_after , keep_before_last , keep_after_last

Synopsis: exp ?substring( from , toExclusive ) , also callable as exp ?substring( from )

A substring of the string. from is the index of the first character. It must be a number that is at least 0 and less than or equal with toExclusive , or else an error will abort the template processing. The toExclusive is the index of the character position after the last character of the substring, or with other words, it is one greater than the index of the last character. It must be a number that is at least 0 and less than or equal to the length of the string, or else an error will abort the template processing. If the toExclusive is omitted, then it defaults to the length of the string. If a parameter is a number that is not an integer, only the integer part of the number will be used.

The string without leading and trailing white-space. Example:

The opposite of cap_first . The string with the very first word of the string un-capitalized.

The upper case version of the string. For example "GrEeN MoUsE" will be "GREEN MOUSE" .

The string after URL escaping. This means that all non-US-ASCII and reserved URL characters will be escaped with % XX . For example:

The output will be (assuming that the charset used for the escaping is an US-ASCII compatible charset):

Note that it escapes all reserved URL characters ( / , = , & , ...etc), so this encoding can be used for encoding query parameter values, for example:

Above no HTML encoding ( ?html ) was needed, because URL escaping escapes all reserved HTML characters anyway. But watch: always quote the attribute value, and always with normal quotation mark ( " ), never with apostrophe quotation mark ( ' ), because apostrophe quotation mark is not escaped by the URL escaping.

To do URL escaping a charset must be chosen that will be used for calculating the escaped parts ( % XX ). If you are HTML page author and you don't really understand this, don't worry: the programmers should configure FreeMarker so that it uses the proper charset by default ( programmers: see more below... ). If you are a more technical minded user, then you may want to know that the charset used is specified by the url_escaping_charset setting, that can be set in template execution time (or, preferably, earlier by the programmers). For example:

Furthermore, you can explicitly specify a charset for a single URL escaping as the parameter to the built-in:

If the url built-in has no parameter, then it will use the charset specified as the value of the url_escaping_charset setting. This setting should be set by the software that encloses FreeMarker (e.g. a Web application framework), because it is not set ( null ) by default. If it is not set, then FreeMarker falls back using the value of the output_encoding setting, which is also not set by default, so it is again the task of the enclosing software. If the output_encoding setting is not set either, then the parameterless url built-in can't be executed, and it will cause execution time error. Of course, the url built-in with parameter always works.

It's possible to set url_escaping_charset in the template with the setting directive, but it is bad practice, at least in true MVC applications. The output_encoding setting can't be set with the setting directive, so that's surely the task of the enclosing software. You may find more information regarding this here...

This is the same as the url built-in , except that it doesn't escape slash ( / ) characters. This meant to be used for converting paths (like paths coming from the OS or some content repository) that use slash (not backslash!) to a path the can be inserted into an URL. The most common reason why this conversion is needed is that folder names or file names might contain non-US-ASCII letters ("national" characters).

Just like with the url built-in , the desired URL escaping charset (or as a fall back, the output encoding) must be set in the FreeMarker configuration settings, or else the built-in will give error. Or, you you have to specify the charset like somePath?url_path('utf-8') .

A sequence that contains all words of the string in the order as they appear in the string. Words are continual character sequences that contain any character but white-space . Example:

The string as XHTML text. That is, the string with all:

  • ' replaced with &#39;

The only difference between this built-in and the xml built-in is that the xhtml built-in escapes ' as &#39; instead of as &apos; , because some older browsers don't interpret &apos; correctly.

The string as XML text. That is, the string with all:

  • ' replaced with &apos;

Many string built-ins accept an optional string parameter, the so called ``flags''. In this string, each letter influences a certain aspect of the behavior of the built-in. For example, letter i means that the built-in should not differentiate the lower and upper-case variation of the same letter. The order of the letters in the flags string is not significant.

This is the complete list of letters (flags):

i : Case insensitive: do not differentiate the lower and upper-case variation of the same letter.

f : First only. That is, replace/find/etc. only the first occurrence of something.

r : The substring to find is a regular expression . FreeMarker uses the variation of regular expressions described at http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html (note that the presence of some pattern features depends on the Java version used).

m : Multi-line mode for regular expressions. In multi-line mode the expressions ^ and $ match just after or just before, respectively, a line terminator or the end of the string. By default these expressions only match at the beginning and the end of the entire string. Note that ^ and $ doesn't match the line-break character itself.

s : Enables dot-all mode for regular expressions (same as Perl singe-line mode). In dot-all mode, the expression . matches any character, including a line terminator. By default this expression does not match line terminators.

c : Permits whitespace and comments in regular expressions.

This outputs this:

This is the table of built-ins that use these common flags, and which supports which flags:

Biegral Blog

Can't convert boolean to string automatically, because the "boolean_format" setting was "true,false".

Biegral 2020/7/14 9:50:11 5854

这个错误其实错误信息中已经提示怎么处理了:

  • Java面试题全集(上) (1099167 )
  • Wi-Fi 爆重大安全漏洞,Android、iOS、Windows 等所有无线设备都不安全了 (421396 )
  • Jquery 使用Ajax获取后台返回的Json数据后,页面处理 (265248 )
  • Java面试题全集(中) (232840 )
  • 一个非常有用的函数——COALESCE (219691 )
  • Java面试题全集(下) (215717 )
  • Uncaught SyntaxError: Unexpected token ) (210262 )
  • 如何用adb连接android手机?(我的亲自经历)------ 顺便说说unable to connect to 192.168.1.100:5555的原因和解决方法 (207434 )
  • 如何利用C/C++逐行读取txt文件中的字符串(可以顺便实现文本文件的复制) (204377 )
  • yum提示Another app is currently holding the yum lock; waiting for it to exit... (202231 )
  • C# 【2859 篇】
  • Java 【2173 篇】
  • SQL 【1413 篇】
  • Python 【1538 篇】
  • JavaScript 【1312 篇】
  • Web 【951 篇】
  • Other 【5469 篇】
  • 2022 【830 篇】
  • 2021 【3441 篇】
  • 2020 【5337 篇】
  • 2019 【2404 篇】
  • 2018 【1756 篇】
  • 2017 【257 篇】
  • 2016 【550 篇】
  • 2015 【166 篇】
  • 2014 【252 篇】
  • 2013 【168 篇】
  • 2012 【137 篇】
  • 2011 【26 篇】
  • 2010 【40 篇】
  • 2009 【50 篇】
  • 2008 【74 篇】
  • 2007 【54 篇】
  • 2006 【173 篇】

Powered by Biegral. Copyright © Biegral's Studio. All rights reserved. 湘ICP备16011611号-1

  • FreeMarker 手册

Non backward-compatible changes!

Changes in ftl (freemarker template language), changes on the java side, other changes, differences between the final and rc2 releases, differences between the rc2 and rc1 releases, differences between the preview 2 and rc1 releases, differences between the preview 1 and preview 2 releases.

Date of release: 2003-03-27

This release introduces some really important new features. Unfortunately, evolution was painful again; we have a few non-backward compatible changes (see below). Also, for those of you awaiting desired native date/time type, sorry, it is still not here (because of some internal chaos in the team... stand by, it's coming).

Macros are now plain variables. This means that if you are unlucky and you have both a macro and another variable with the same name, now the variable will overwrite the macro, so your old template will malfunction. If you have a collection of common macros, you should use the new namespace feature to prevent accidental clashes with the variables used in the templates.

With the introduction of the new namespace support , global and assign directives are no longer synonyms. assign creates a variable in the current namespace , while global creates variable that is visible from all namespaces (as if the variable would be in the data-model). Thus, the variable created with assign is more specific, and hides the variable of the same name created with global . As a result, if you use both global and assign mixed for the same variable in your templates, now they will malfunction. The solution is to search-and-replace all global s in your old templates with assign .

The reserved hash root no longer exists as a predefined variable (we no longer have reserved variables). Use special variable expressions to achieve similar effects. However, we have no equivalent replacement for root because of the changes in the variable scopes caused by the introduction of namespaces. You may should use .globals or .namespace .

The BeansWrapper no longer exposes native Java arrays, booleans, numbers, enumerations, iterators, and resource bundles as TemplateScalarModel . This way, number objects wrapped through BeansWrapper are subject to FreeMarker's number formatting machinery. Also, booleans can be formatted using the ?string built-in.

The signature of Configuration.setServletContextForTemplateLoading has been changed: the first parameter is now Object instead of javax.servlet.ServletContext . Thus, you have to recompile your classes that call this method. The change was required to prevent class-loading failure when javax.servlet classes are not available and you would not call this method.

This release introduces a parse-time white-space remover that strips some of the typical superfluous white-space around FreeMarker tags and comments. This feature is on by default! Most probably this will not cause problems if you generate white-space neutral output like HTML. But if it does cause undesirable reformatting in output you generate, you can disable it with config.setWhitespaceStripping(false) . Also, you can enable/disable it on a per-template basis with the new ftl directive.

Some new directives were introduced: nested , import , escape , noescape , t , rt , lt . This means that if you are unlucky and the text of your template contains something like <nested> , then that will be misinterpreted as a directive. To prevent this kind of problem in the future, we recommend everybody to switch from the old syntax to the new syntax (``strict syntax''). The strict syntax will be the the default syntax starting from some of the later releases anyway. We plan to release a conversion tool for converting old templates. For more information please read: 模板语言参考 /废弃的 FTL 结构/老式 FTL 语法

The data-model created by the FreemarkerServlet now uses automatic scope discovery, so writing Application. attrName , Session. attrName , Request. attrName is no longer mandatory; it's enough to write attrName (for more information read this ). This may break an old template if that rely on the non-existence of certain top-level variables.

FreemarkerServlet now uses the encoding of the template file for the output, unless you specify the encoding in the ContentType init-param, such as text/html; charset=UTF-8 .

The format of template paths is now more restricted than before. The path must not use / , ./ and ../ and :// with other meaning as they have in URL paths (or in UN*X paths). The characters * and ? are reserved. Also, the template loader must not want paths starting with / . For more information please read: 程序开发指南/配置(Configuration)/模板加载

Till now TemplateTransformModel.getWriter has received null as parameter map if the transform was called without parameters. From now, it will receive an empty Map instead. Note that the previous API documentation didn't state that it always receives null if there are no parameters, so hopelessly only very few classes exploit this design mistake.

User-defined directives: Transform and macro call syntax has been unified; they can be called in the same way, as user-defined directives. This also means that macros support named parameters and nested content (like the -- now deprecated -- transform directive did). For example, if you have a macro called sect , you may call it via <@sect title="Blah" style="modern">Blah blah...</@sect> . For more information read: 模板开发指南/其它/自定义指令

Macros are now plain variables. This significantly simplifies FreeMarker semantics, while providing more flexibility; for example you can pass macros as parameters to other macros and transforms. As for the problem of clashing commonly-used-macro and variable names, we provide a more powerful solution: namespaces.

Namespaces: Names-spaces are invaluable if you want to assemble collections (``libraries'') of macros and transforms (and other variables), and then use them in any template without worrying about accidental name clashes with the application specific and temporary variables, or with the variables of other collections you want to use in the same template. This is extremely important if FreeMarker users want to share their macro/transform collections. For more information read: 模板开发指南/其它/命名空间

With the introduction of namespaces our variable related terminology changed. As a result, assign is no longer synonymous with global . The assign directive has been undeprecated, and should be used instead of global almost everywhere. In the new approach assign creates variables in the current namespace, while global creates a variable that is visible from all namespaces (as if the variable were in the root of the data-model). A variable created with assign in the current namespace hides the variable of the same name that was created with global .

ftl directive: With this directive you can give information about the template for FreeMarker, like the encoding (charset) of the template, the used FTL syntax variant, etc. Also, this directive helps you to write templates that are less dependent on FreeMarker configuration settings, also it helps third-party tools to identify and correctly parse FreeMarker templates. For more information see: ftl directive

White-space stripping: FreeMarker now automatically removes some of the typical superfluous white-spaces around FreeMarker tags and comments, like the indentation spaces before- and line-break after <#if ...> tags. For more information read: 模板开发指南/其它/空白处理/剥离空白

New directive to apply a common ("escaping") expression to all interpolations in a block: escape . The name comes from the common usage of this directive for automatic HTML-escaping of interpolations.

The new and preferred way of number formatting with string built-in is foo?string(format) , instead of the less natural foo?string[format] .

The string built-in works for boolean values. For example: ${spamFilter?string("enabled", "disabled")} . For more information read the reference .

The default strings for outputting boolean value using the string built-in can be set using the boolean_format setting.

Comments can be placed inside FTL tags and interpolations. For example: <#assign <#-- a comment --> x = 3>

All letters and numbers are enabled in variable names, also $ is allowed (as in Java programming language). Thus you can use accents, Arabic letters, Chinese letters, etc.

String literals can be quoted with apostrophe-quote. "foo" and 'foo' are equivalent.

New string built-ins : index_of , last_index_of , starts_with , ends_with , replace , split , chop_linebreak , uncap_first .

New sequence built-ins : sort , sort_by .

New built-ins for experts to check the type of a variable. See: is_ ... built-ins

New built-in for experts to create a variable of certain Java TemplateModel implementation. See: new built-in

New built-in, namespace , to get the namespace of a macro.

New expression type: special variable expression. To prevent backward compatibility problems when we introduce new predefined variables, from now special variable expressions are used to access them.

New directives: t , rt and lt directives allow you to do explicit white-space removal in extreme FTL applications. For more information read the reference .

assign , local and global now can capture the output generated be the nested template fragment into the variable. This deprecates capture_output transform. More information: assign directive reference

Bulk assignments (as <#assign x=1, y=2, z=3> ) no longer need colon to separate the assignments (as <#assign x=1 y=2 z=3> ), although it is still allowed to preserve backward compatibility.

Path that contains //: is considered as absolute path.

include and transform directives no longer need a semicolon to separate the template or transform name from the parameter list, although it is still allowed to preserve backward compatibility.

# -less tag syntax is deprecated (but still working). That is, you should write <# directive ... > instead of < directive ... > , and </# directive ... > instead of </ directive ... > . For more info read: 模板语言参考 /废弃的 FTL 结构/老式 FTL 语法

foreach is depreciated (but still working). Use list instead.

Bugfix: Undefined variables in hash and sequence constructors (as [a, b, c] ) didn't caused errors.

Bugfix: String concatenation had performance problem if there was multiple concatenations chained, as: "a"+x+"a"+x+"a"+x+"a"+x+"a"+x .

Arbitrary JSP custom tags can be used as FreeMarker transforms in FreemarkerServlet -driven templates. More information: 程序开发指南/其它/在Servlet中使用FreeMarker

Various improvements for BeansWrapper :

The BeansWrapper no longer exposes arbitrary objects as TemplateScalarModel s, only java.lang.String and Character objects. This way, number objects wrapped through BeansWrapper are subject to FreeMarker's number formatting machinery. As a side effect, non-string and non-number objects that were previously accepted in equality and inequality operations (because they had a string representation) will now cause the engine to throw exception on comparison attempt.

java.lang.Character objects are exposed as scalars through BeansWrapper .

Experimental feature: With the setSimpleMapWrapper method of BeansWrapper you can configure it to wrap java.util.Map -s as TemplateHashModelEx -s, and do not expose the methods of the object.

TransformControl interface (was experimental earlier): If the Writer returned by TemplateTransformModel.getWriter implements this interface, it can instruct the engine to skip or to repeat evaluation of the nested content, and gets notified about exceptions that are thrown during the nested content evaluation. Note that the onStart and afterBody methods now are allowed to throw IOException . For more information please read the API documentation.

Localized lookup can be disabled with the new Configuration methods: set/getLocalizedLookup , clearTemplateCache

The new interface freemarker.cache.CacheStorage allows users to plug custom template caching strategies with the cache_storage setting. The core package now ships with two implementations: SoftCacheStorage and StrongCacheStorage . For more information read: 程序开发指南/配置(Configuration)/模板加载

You can set settings with string name and string value with the new setSetting(String key, String value) method of Configurable super-classes (as Configuration ). Also you can load settings from .properties file with the setSettings method.

Other new Configuration methods: clearTemplateCache , clearSharedVariables , getTemplateLoader , and clone .

Changes to TemplateTransformModel interface: getWriter can throw IOException , and can return null if the transform does not support body content.

Various improvements for FreemarkerServlet :

The data-model now uses automatic scope discovery, so writing Application. attrName , Session. attrName , Request. attrName is no longer mandatory; it's enough to write attrName . For more information read this .

All Configuration level settings can by set with Servlet init-params ( template_exception_handler , locale , number_format , etc.).

The object wrapper the servlet internally uses is now set as the default object wrapper for its Configuration instance.

It no longer forces session creation for requests that don't belong to an existing session, improving scalability.

JDOM independent XML-wrapping: freemarker.ext.xml.NodeListModel is a re-implementation of freemarker.ext.jdom.NodeListModel that does not rely on JDOM; you don't need JDOM .jar anymore. The new NodeListModel automatically uses W3C DOM, dom4j, or JDOM, depending on which library is available (that is, depending on what object do you pass to its constructor).

Bugfix: WebappTemplateLoader : Template updating didn't worked correctly with Tomcat due the caching of resources. Now WebappTemplateLoader tries to access the resources directly as File , if it is possible, thus bypasses the caching.

Various bug-fixes for FreemarkerServlet :

The servlet now loads the correct template if it was called through RequestDispatcher.include .

The caching of HttpServletRequest objects is now compliant with the servlet specification.

TemplateException s was suppressed in certain situations resulting in half-rendered pages without error message.

Bugfix: FreeMarker didn't work if the javax.servlet classes was not available, because Configuration explicitly referred to javax.servlet.ServletContext .

Bugfix: classes may were not found if they was available only in the WEB-INF , and FreeMarker tried to load the class dynamically.

Bugfix: the Template constructor (and thus Configuration.getTemplate ) sometimes threw TokenMgrError (a non-checked exception) instead of ParseException .

The Web application related examples has been replaced.

The history of the releases before the final version

You can load settings from .properties file with the setSettings method of Configuration and other Configurable subclasses.

New string built-in: uncap_first

Bugfix: When exposing an XML document to a template and accessing it with XPath using Jaxen a ClassCastException has occurred.

Bugfix: The template cache has loaded templates with bad Configuration instance in certain situations if you use not the static default Configuration instance.

Non backward compatible change!: FreemarkerServlet now uses the encoding of the template file for the output, unless you specify the encoding in the ContentType init-param, such as text/html; charset=UTF-8 .

Non backward compatible change compared to RC1!: The capture_output transform creates variable in the current namespace (as assign directive) with the var parameter, not a global variable.

You can set settings with string name and string value with the new setSetting(String key, String value) method of Configurable super-classes (as Configuration ).

Other new Configuration methods: getTemplateLoader , clone .

Changes to TemplateControl interface: onStart and afterBody methods are now allowed to throw IOException .

New string built-ins : index_of , last_index_of , starts_with , ends_with , replace , split , chop_linebreak .

Bugfix: setLocalizedLookup(false) of Configuration was overridden when you have called setTemplateLoader .

Bugfix: white-space stripping was not worked with tags spanning over multiple lines.

Bugfix: Removing several dependencies on JDK 1.3, so FreeMarker can be build for JDK 1.2.2.

ftl is now stricter, and does not allow custom parameters. To associate custom attributes to templates, we may add a new directive later, if there is a demand for it.

escape directive does not affect numerical interpolations ( #{ ... } ) anymore, as it has caused errors with string escapes as ?html .

The normalizeName method of freemarker.cache.TemplateLoader has been removed, because it has caused too many complications. Instead, normalization happens on a single point in the TempateCache . In consequence, FreeMarker is now stricter about the format of template paths, as things like /../ are interpreted by the core.

New Configuration methods: set/getLocalizedLookup , clearTemplateCache , clearSharedVariables .

More cleanups in the Environment API.

Better JSP standard compliance: JSP page-scope variables are the global variables that were created in the template (not the variables of the data-model).

Bugfix: Templates loaded with MultiTemplateLoader subclasses was removed from the template cache after the template update delay has elapsed (5 seconds by default) even if the template file was unchanged. This can cause lot of extra load for a high-traffic server if you have many templates or if the template update delay was set to 0 second.

All 16-bit Unicode letters and numbers are allowed in identifiers, as well as the $ character (as in Java programming language). Thus you can use accented letters, Arabic letters, Chinese letters, etc. as identifiers in templates

Macros now can create loop variables for the nested content. For more information read this .

The syntax of assignment-with-namespace has changed from <#assign foo=123 namespace=myLib> ) to <#assign foo=123 in myLib> , since the previous syntax was confusing because its similarity to a bulk-assignment.

Positional parameter passing is supported for macro calls as shorthand form of normal named parameter passing. For more details read read the reference .

New built-in, namespace , to get the namespace of the currently executing macro.

TransformControl interface (was experimental earlier): If the Writer returned by TemplateTransformModel.getWriter implements this interface, it can instruct the engine to skip or to repeat evaluation of the nested content, and gets notified about exceptions that are thrown during the nested content evaluation. For more information please read the API documentation.

Jython wrapper can now wrap arbitrary Java objects, not only PyObject -s. If an object is passed to the wrapper that is neither a TemplateModel , nor a PyObject , it is first coerced into a PyObject using Jython's own wrapping machinery, and then wrapped into a TemplateModel as any other PyObject .

Some cleanups in the Environment API.

Bugfix: Templates loaded with URLTemplateLoader subclasses was removed from the template cache after the template update delay has elapsed (5 seconds by default) even if the template file was unchanged. This can cause lot of extra load for a high-traffic server if you have many templates or if the template update delay was set to 0 second.

Bugfix: FreeMarkerServlet has thrown ServletException even if a debug TemplateException handler was in use (so you may got Error 500 page instead of debug information).

  • What is FreeMarker?
  • Version history

Handy stuff

  • Try template online
  • Expressions cheatsheet
  • .special_vars
  • Chinese Manual on Github
  • FreeMarker on Github
  • Follow us on Twitter
  • Report a bug
  • Ask a question
  • Mailing lists
  • Stack Overflow

Generated for: Freemarker 2.3.23 Last generated: 2015-09-18 14:38:51 GMT

© 1999 –2015 The FreeMarker Project . All rights reserved.

IMAGES

  1. Getting started with FreeMarker

    freemarker set boolean_format

  2. Spring MVC and FreeMarker

    freemarker set boolean_format

  3. Introduction and use of freemarker

    freemarker set boolean_format

  4. Introduction to FreeMarker Template (FTL). FTL Tutorial

    freemarker set boolean_format

  5. FreeMarker Tutorial for Beginners

    freemarker set boolean_format

  6. The third day of micro HR: SpringBoot integrates Freemarker

    freemarker set boolean_format

VIDEO

  1. Implementation of Boolean Function using Multiplexer

  2. Implementation of Boolean Function using Multiplexer

  3. Creating Circuit from Boolean Expression

  4. JavaScript Booleans Demystified: True or False? ✔️❌

  5. Determine The Value Of Boolean Variable To Get Output 1

  6. MODO

COMMENTS

  1. The Best Settings and Formats for Converting Video to Audio MP3

    Converting video files to audio MP3 format is a common task, especially for those who want to enjoy their favorite music or podcasts on the go. However, finding the right settings and formats for this conversion can be quite challenging.

  2. A Comprehensive Guide to APA Formatting Help

    APA formatting is a common style of writing used in academic and professional settings. It is often used for research papers, journal articles, and other documents. The first step in getting started with APA formatting is to familiarize you...

  3. Understanding the Different Formats: FLAC vs. MP3 for High-Quality Audio

    When it comes to enjoying music, having the best audio quality is crucial for a truly immersive experience. With the advent of digital music, there are various formats available, each with its own set of pros and cons.

  4. Built-ins for booleans

    foo?string : Deprecated starting from FreeMarker 2.3.20: use ?c instead, or set the boolean_format

  5. freemarker

    c for "computer format", also used for numbers). ${booleanVar?string} is dangerous for that, since somebody can set the boolean_format setting

  6. setting

    boolean_format : The comma-separated pair of strings for representing true and false values respectively that is used to convert booleans to strings when no

  7. freemarker.template.Configuration.setBooleanFormat java ...

    * Sets the boolean format used to convert boolean to strings, as defined * by {@link Configuration#setBooleanFormat(String)}. Note that it can't be {@code

  8. FreeMarker Manual

    foo?string: Deprecated starting from FreeMarker 2.3.20: use ?c instead, or set the boolean_format

  9. FreeMarker Manual

    Changes on the FTL side ·? · If the boolean_format setting is set to anything but the default "true,false" value, boolean values will be

  10. Built-ins for booleans

    string: This will convert the boolean to string using the default strings for representing true and false values. By default, true is rendered as "true" and

  11. Configuration (FreeMarker 2.3.29 API)

    Getter pair of setRegisteredCustomOutputFormats(Collection) . java.util.Set<java.lang.String>, getSettingNames(boolean camelCase). Returns the

  12. FreeMarker Manual

    The string converted to boolean value. The string must be true or false (case sensitive!), or must be in the format specified by the boolean_format setting. If

  13. Can't convert boolean to string automatically, because the

    ... FreeMarker template error: Can't convert boolean to string automatically ... set the "boolean_format" setting to something like "yes,no".

  14. 2.2

    set using the boolean_format setting. Comments can be placed inside FTL tags