freemaker中使用 jspTaglibs

本文介绍了如何在Freemarker中使用JspTaglibs,通过指定URL访问tld文件。示例展示了如何配置和使用Spring的标签库,解析了URI与tld文件的关系,以及在spring-webmvc.jar中找到对应的spring.tld。
摘要由CSDN通过智能技术生成

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>

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值