今天在写页面的时候又掉坑里了,使用freemarker获取对象的属性,其中一个属性(“rName”)死活获取不到,上代码:
<#list multyAccountList as accountInfo>
<div class="radio-group">
<div class="radio-check">
<input type="radio" name="c-radio" class="i-radio" value="${accountInfo.userId}"/>
<#if purchaserVO.loginAccount == accountInfo.loginAccount>
<em class="iconfont pur_icon_PC_Checkbox_pre"></em>
<#else >
<em class="iconfont pur_icon_PC_Checkbox_nor"></em>
</#if>
</div>
<label class="radio-lab">${accountInfo.userName}(${accountInfo.orgName},${accountInfo.rName})</label>
</div>
</#list>
其他的都能获取到。。。
尝试了下,把"rName"的值放到另一个属性(“orgName”)中能获取到。。。
那么问题应该出现在页面获取上。。。
freemarker的取值方式是:
${object.param}
也相当于getParam。那么获取"rName"的时候,应该是getRName。
尝试了一下果然如此:
${accountInfo.RName}