freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhouyanming (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FREEMARKER-33) <#list map as k,v> doesn't works as expected
Date Thu, 08 Sep 2016 02:21:20 GMT

    [ https://issues.apache.org/jira/browse/FREEMARKER-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15472466#comment-15472466
] 

zhouyanming commented on FREEMARKER-33:
---------------------------------------

SimpleMapModel cannot use map.entrySet() , I think the most common sense behavior should be
MapModel but keySet() only return map.keySet().

> <#list map as k,v> doesn't works as expected
> --------------------------------------------
>
>                 Key: FREEMARKER-33
>                 URL: https://issues.apache.org/jira/browse/FREEMARKER-33
>             Project: Apache Freemarker
>          Issue Type: Bug
>          Components: engine
>    Affects Versions: 2.3.25-incubating
>            Reporter: zhouyanming
>             Fix For: 2.3.26-incubating
>
>
> {code:java}
> package test;
> import java.util.HashMap;
> import java.util.Map;
> public class MapFactory {
> 	public static Map<String, String> create() {
> 		Map<String, String> map = new HashMap<>();
> 		map.put("mykey", "myvalue");
> 		return map;
> 	}
> }
> {code}
> {code:html}
> <#list statics['test.MapFactory'].create() as k,v>
> ${k}
> </#list>
> {code}
> I am expecting "mykey" only, but it render others like "getClass values .." also.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message