freemaker中使用 jspTaglibs

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>

猜你喜欢

转载自slnddd.iteye.com/blog/2359808