Alguém pode me ajudar a mapear este displaytag?
<action path="/listaContatos" type="action.ListaContatosAction">
<forward name="lista" path="/lista.jsp" />
<forward name="vazia" path="/lista-vazia.jsp" />
</action>
public class ListaContatosAction extends Action{
public ActionForward execute(ActionMapping map, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
List lista = new ContatoDAO().getLista();
request.setAttribute("contatos", lista);
if(lista.isEmpty()) {
return map.findForward("vazia");
} else {
return map.findForward("lista");
}
}
}
<%@ taglib uri="/WEB-INF/displaytag.tld" prefix="display"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Cp1252"/>
<title></title>
</head>
<body>
<h1><u>Precos dos softwares:</u></h1>
<display:table name="contatos" id="xxxx" requestURI="xxxx" sort="list" export="true">
<display:column property="nome" title="nome" sortable="true"/>
</display:table>
</body>
</html>
Grato, Carlos.