今天在寫頁面的時候又掉坑裏了,使用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}