freemaker中使用jspTaglibs : http://freemarker.org/docs/pgui_misc_servlet.html
<#assign spring=JspTaglibs["http://www.springframework.org/tags"]>
<@spring.message code="${code}" />
如上所示,在freemaker中使用jspTaglibs可以指定一个Url就可以访问定义好的tld文件了。
起初我不知道http://www.springframework.org/tags这个对应的是哪个tld文件,后来在网上查找到
The form tag library comes bundled in spring-webmvc.jar. The library descriptor is called spring-form.tld.
To use the tags from this library, add the following directive to the top of your JSP page:
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
where form is the tag name prefix you want to use for the tags from this library.
然后就去spring-webmvc.jar的META-INF下找到了spring.tld,这才明白调用的是这个
<description>Spring Framework JSP Tag Library</description>
<tlib-version>3.0</tlib-version>
<short-name>spring</short-name>
<uri>http://www.springframework.org/tags</uri>
本文介绍了如何在Freemarker中使用JspTaglibs,通过指定URL访问tld文件。示例展示了如何配置和使用Spring的标签库,解析了URI与tld文件的关系,以及在spring-webmvc.jar中找到对应的spring.tld。

被折叠的 条评论
为什么被折叠?



