Estou tentando fazer um exemplo com o displayTag, porém não estou conseguindo entender exatamente como ele funciona, se alguem puder me ajudar ficarei mto grata.
Classe Person :
public class Person {
public String nome;
public String email;
public String Id;
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getId() {
return Id;
}
public void setId(String id) {
Id = id;
}
Classe TesteAction:
public class TesteAction extends HttpServlet {
private ArrayList<Person> people;
public TesteAction() {
people = new ArrayList<Person>();
addPerson("Pessoa1", "1", "[email removido]");
addPerson("Pessoa2", "2", "[email removido]");
addPerson("Pessoa3", "3", "[email removido]");
}
private void addPerson(String nome, String id, String email) {
Person person = new Person();
person.setNome(nome);
person.setId(id);
person.setEmail(email);
}
public ArrayList<Person> getPeople(){
return people;
}
index.jsp:
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<display:table name="people" requestURI="teste.TesteAction">
<display:column property="id" title="ID" />
<display:column property="nome" />
<display:column property="email" />
</display:table>
</body>
</html>
