Use of freemarker if... else..., freemarkerifelse

Source: Internet
Author: User

Use of freemarker if... else..., freemarkerifelse

FreeMarker is a template engine that is easy to use on the Pad end today. Its usage is very simple:

In the xml configuration page file, directly use

1 <# if 1 = 1> 2 3 // The condition is true. The content to be displayed is 4 5 </# if>

The modified code is as follows:

1 <p CLASS = "p2"> dear $ {appntName }$ {appntSex }:</p> 2 <P> hello! Thank you for your application for the XX products of XX Company. After careful review, the company makes the following decisions on your application: </p> 3 <# if letterStatus = '3'> 4 <P> XX persons due to primary risk $ {insurName} have $ {postphoneReason }, all products applied for this application are not accepted for the moment. If you still want to purchase $ {postponePeriod}, please apply again. </P> 5 <# else> 6 <P> because $ {insurName} has $ {declineReason}, none of this application will pass. </P> 7 </# if> 8 <p> thanks again for your support. </P>

 

Manual reminder: At the beginning, the error is generated because you did not pay attention to it and forgot/. The HTML code generated during debug is always incorrect.

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.