I am using a template which accesses public fields of a Customer
object like this:
-
As @Ahmet stated in the comments, I do not need any additional OGNL dependencies. Would've surprised me anyway. The problem was, that my model class looked like this:
public class Customer {
public String addressee;
public String street;
public String postalCode;
public String city;
public String country;
}
I was not aware, that there are explicit public getter methods required. I had to change the model to
public class Customer {
private String addressee;
private String street;
private String postalCode;
private String city;
private String country;
public String getAddressee() {
return addressee;
}
public void setAddressee(String addressee) {
this.addressee = addressee;
}
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
}
In order to make it work.
讨论(0)