开发者

Generate URLs with parameters in Freemarker similar to jstl's c:url

开发者 https://www.devze.com 2023-01-26 18:58 出处:网络
I am newbie to Freemarker & am pretty sure there would be an easy way to do this开发者_如何学Go. Essentially in my jsp page I have something like this,

I am newbie to Freemarker & am pretty sure there would be an easy way to do this开发者_如何学Go. Essentially in my jsp page I have something like this,

<c:url var="myURL" value="/amount">
    <c:param name="currency" value="dollars"/>
</c:url>

I am porting this to .ftl now. So I wanted to know is there a way to do it in ftl? I dont want to pass the url from the servlet. There are way too many.


I don't know of a direct translation for that into FreeMarker, but you could write a custom directive to handle that easily. FreeMarker has built ins for URL escaping as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号