Closed otary closed 7 years ago
example:
public class Staff { private String rType; public String getrType() { return rType; } public void setrType(String rType) { this.rType = rType; } public Staff(String rType) { this.rType = rType; } }
ST st = new ST("<s.rType>"); st.add("s", new Staff("22")); System.out.println(st.render()); //return no data
why? The Object properties can not start with 'r'?
StringTemplate uses JavaBeans conventions, so your accessor for Staff.rType should be called getRType (and setRType).
Staff.rType
getRType
setRType
@jeff5 is correct! (and thanks for answering so quickly)
example:
why? The Object properties can not start with 'r'?