我使用freeer+springMVC的框架,不知道在.ftl文件中如何截取指定长度的中文字符串,freemakert有自己的函数吗? (还是需要使用其它的标签,如何使用标签)

解决方案 »

  1.   

    <#if news.title?length lt 13 > 
                                       ${news.title}
                                      <#else>
                                       ${news.title[0..12]}...
                                      </#if>
      

  2.   

    http://www.devbar.org/articleDetail_112.html