[英]Using Java Set in FreeMarker
From my Java code I am returning Set
of Address
class objects... Now in FreeMarker I want to display the value of all this Address
class objects values.. 从我的Java代码中,我将返回Set
of Address
类对象...现在在FreeMarker中,我想显示所有这些Address
类对象值的值。
My Java Class 我的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;
}
in FreeMarker I am doing following 在FreeMarker中,我正在关注
[#list addList as ${setaddress!''} Phone : ${addList.phone!''}<br/>
Land Line : ${addList.landLineNumber!''}
[/#list]
Now I am getting the error while populating so is it the correct way??? 现在我在填充时遇到错误,所以这是正确的方法吗???
Have you copy-pasted your template properly here? 您是否在此处正确复制粘贴了模板? Because it looks weird. 因为看起来很奇怪。 It should be something like: 应该是这样的:
[#list addList as add]
${setaddress!''} Phone : ${add.phone!''}<br/>
Land Line : ${add.landLineNumber!''}
[/#list]
Also, if you don't get any meaningful error message, just a FileNotFoundError
, something is wrong with the integration of FreeMarker there... 另外,如果没有任何有意义的错误消息,则只是FileNotFoundError
,那里的FreeMarker集成有问题...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.