Freemarker include directive (3.3)

Source: Internet
Author: User

You can use the include directive to insert another Freemarker template file in the template.

Grammar:

<#include path/>  or < #include path options/>

Description

    1. Path: Paths to include files. You can use relative paths and absolute paths. Usually use/(slash) to split the path component.
    2. The supported options are:

Encoding: An expression that counts as a string. The encoding by which the included file inherits from the contained file. (Iso-8859-2, UTF-8, GB2312)

Parse: An expression that counts as a Boolean value. The default is true. If it is true, then the included files will be interpreted as FTL, or the entire file will be treated as simple text. (That is, the freemarker structure is not found in it)

Example:

<#include "FOOLTER.FTL"/>

Note:

    1. The output format of the included template is inserted at the location where the include tag appears.
    2. The contained file and the template that contains it share the variable as if it were copied and pasted in.
    3. This directive cannot be confused with the include of a JSP (servlet) because it does not involve the servlet container, but only the other Freemarker template, and cannot "leave" the Freemarker.

Freemarker include directive (3.3)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.