Re: Macro's hash parameter?

hezjing <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Yes, it works without the quotes!

Thank you!


On Tue, May 6, 2008 at 12:26 AM, Denis <[email protected]> wrote:
>
>  > Hi
>  >
>  > I have an empty FreeMarker's macro
>  >
>  >   <#macro test data>
>  >   </#macro>
>  >
>  >
>  > then in the FreeMarker's template
>  >
>  >   <@test data="${userType}" />
>  >
>
>  Probably because Freemarker doesn't know how to convert a map to a
>  string. Why don't you pass the parameter without quotes?
>
>
>  <@test data=userType />
>
>  >
>  > where userType is a Java's Map object.
>  >
>  > Unfortunately, the above will cause the following error,
>  >
>  >   Expecting a string, date or number here, Expression userType is
>  > instead a freemarker.template.SimpleHash
>  >
>  >
>  > How do I pass a Hash (or Map) parameter to a macro?
>  >
>  >
>  > --
>  >
>  > Hez
>  >
>  > ---
>  > ----------------------------------------------------------------------
>  > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>  > Don't miss this year's exciting event. There's still time to save
>  > $100.
>  > Use priority code J8TL2D2.
>  > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>  > _______________________________________________
>  > FreeMarker-user mailing list
>  > [email protected]
>  > https://lists.sourceforge.net/lists/listinfo/freemarker-user
>
>  -------------------------------------------------------------------------
>  This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>  Don't miss this year's exciting event. There's still time to save $100.
>  Use priority code J8TL2D2.
>  http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>  _______________________________________________
>  FreeMarker-user mailing list
>  [email protected]
>  https://lists.sourceforge.net/lists/listinfo/freemarker-user
>



-- 

Hez

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.