[英]Using Java Set in FreeMarker
從我的Java代碼中,我將返回Set
of Address
類對象...現在在FreeMarker中,我想顯示所有這些Address
類對象值的值。
我的Java課
public class Address implements java.io.Serializable {
private String phone;
private String landLineNumber;
public Address() {}
public String getPhone() {
return this.phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getLandLineNumber() {
return this.landLineNumber;
}
public void setLandLineNumber(String landLineNumber) {
this.landLineNumber = landLineNumber;
}
在FreeMarker中,我正在關注
[#list addList as ${setaddress!''} Phone : ${addList.phone!''}<br/>
Land Line : ${addList.landLineNumber!''}
[/#list]
現在我在填充時遇到錯誤,所以這是正確的方法嗎???
您是否在此處正確復制粘貼了模板? 因為看起來很奇怪。 應該是這樣的:
[#list addList as add]
${setaddress!''} Phone : ${add.phone!''}<br/>
Land Line : ${add.landLineNumber!''}
[/#list]
另外,如果沒有任何有意義的錯誤消息,則只是FileNotFoundError
,那里的FreeMarker集成有問題...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.