在jsp代码中这样写<vlh:column title="First" property="firstNameAsString" adapterProperty="firstName" sortable="desc" />
相应的pojo中要加上getFirstNameAsString这个函数
public class Player {
public Player() { }
public Player(String name, String firstName, String middleName, String lastName, String status, String position) { id = "ID" + idSequence++; this.name = name; this.firstName = firstName; this.middleName = middleName; this.lastName = lastName; this.status = status; this.position = position; }
public String getId() { return id; }
public void setId(String id) { this.id = id; }
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public String getFirstName() { return firstName; }
//注意这个函数
public String getFirstNameAsString() { return firstName + " as an String"; }
public void setFirstName(String firstName) { this.firstName = firstName; }
public String getLastName() { return lastName; }
public void setLastName(String lastName) { this.lastName = lastName; }
public String getMiddleName() { return middleName; }
public void setMiddleName(String middleName) { this.middleName = middleName; }
public String getPosition() { return position; }
public void setPosition(String position) { this.position = position; }
public String getStatus() { return status; }
public void setStatus(String status) { this.status = status; }
public String toString() { return firstName + " " + lastName; }
private static long idSequence; private String id; private String name; private String firstName; private String middleName; private String lastName; private String status; private String position;
}