Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Templates 如何使用freemarker访问列表中对象的属性以及列表对象在hashmap中的属性?_Templates_Hashmap_Javabeans_Freemarker - Fatal编程技术网

Templates 如何使用freemarker访问列表中对象的属性以及列表对象在hashmap中的属性?

Templates 如何使用freemarker访问列表中对象的属性以及列表对象在hashmap中的属性?,templates,hashmap,javabeans,freemarker,Templates,Hashmap,Javabeans,Freemarker,我正在尝试访问对象的属性。但我很抱歉这个错误 FreeMarker template error: The following has evaluated to null or missing interestRate [in template "interestRate" at line 2, column 8] 在我的代码中,我创建了一个pojoclass对象列表,并用hasmap映射这个列表 List<InterestRateVO> list = new ArrayList

我正在尝试访问对象的属性。但我很抱歉这个错误

FreeMarker template error:
The following has evaluated to null or missing
interestRate  [in template "interestRate" at line 2, column 8]
在我的代码中,我创建了一个pojoclass对象列表,并用hasmap映射这个列表

List<InterestRateVO> list = new ArrayList<InterestRateVO>();
Map<String,List<InterestRateVO>> interestRate = new HashMap<String,List<InterestRateVO>> ();
list.add(interestRateVO);
interestRate.put(tableData[1],list);
这是我的小姑娘

public class InterestRateVO {


    private String currency;
    private String rate;
    public String getCurrency() {
        return currency;
    }
    public void setCurrency(String currency) {
        this.currency = currency;
    }
    public String getRate() {
        return rate;
    }
    public void setRate(String rate) {
        this.rate = rate;
    }

}
我用的是这个代码

<#list interestRate?keys as inter>
  ${inter} = ${interestRate[inter].currency} 
</#list>
你把兴趣图本身放在数据模型的什么地方。模板上下文?是否向视图发送interestRate?
<#list interestRate?keys as inter>
  ${inter} = ${interestRate[inter].currency} 
</#list>