Java Mailing List Archive

http://www.junlu.com/

Home » FreeMarker-user »

[FreeMarker-user] Calling macro with tricky parameter name

Jerker Klang

2012-02-22

Replies: Find Java Web Hosting

Author LoginPost Reply
Hello all,

I have a macro that I want to use for producing html5 page (fragments).
It looks like this:

<#macro input id params...>
<#list params?keys as param>
  Key: ${param}<br />
  Value: ${params[param]}<br />
</#list>
</#macro>

Question: How do I call that macro with parameter named data-custom with
the value freemarker?

The naive aproach would have been:

<@(protected)" />

Background:
In html5 they have the new convention that you can enter custom data
attributes on elements by using a data- prefix on all attributes. I
suspect that my question is likely to reoccur in the future as html5
becomes more common.

I've browsed through the FAQ and .vars in mentioned for accessing the
variables but that isn't a problem me (since I'm iterating through params).

Is there a way to specify a tricky parameter name somehow?

Thanks in advance!

//Jerker


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
FreeMarker-user mailing list
FreeMarker-user@(protected)
https://lists.sourceforge.net/lists/listinfo/freemarker-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.