I've been doing the exercise 6.4 Optional exercises: Caelum's list of contacts with scriptlet and there's a question that says: " 2) Notice that the date appeared in a complicated way Try formatting it using the class SimpleDateFormat "
I need this section:
String dataFormatada = new SimpleDateFormat("dd/MM/yyyy").format(contato.getDataNascimento())
But I do not know where to put it already I've tried replacing the <% = contact.getDataNascimen .... , already tried off the table and nothing ..
This is my code!
<table>
<tr>
<th>Nome</th>
<th>E-mail</th>
<th>Endereço</th>
<th>Data de Nascimento</th>
</tr>
<%
ContatoDao dao = new ContatoDao();
List<Contato> contatos = dao.getLista();
for (Contato contato : contatos){
%>
<tr>
<td><%=contato.getNome() %></td>
<td><%=contato.getEmail() %></td>
<td><%=contato.getEndereco() %></td>
<td><%=contato.getDataNascimento().getTime() %></td>
</tr>
<%
}
%>
</table>