<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Probando API Json desde Java</title>
</head>
<body>
<h1>Probando API Json desde Java</h1>
<form method="post" action=\'<%= request.getContextPath() + "/PersonaServlet"%>\'>
Nombre: <input name="name" /><br/>
Sexo: <input name="gender" type="radio" value="H" />Hombre |
<input name="gender" type="radio" value="M" />Mujer<br/>
¿Trabaja? <input name="worker" type="checkbox" value="S" /><br/>
<input type="submit" value="Enviar" />
<input type="reset" value="Limpiar" />
</form>
<jsp:include page="/PersonaServlet" flush="true" />
<hr/>
<h2>Resultado</h2>
<table >
<thead>
<tr>
<th>ID</th>
<th>Nombre</th>
<th>Sexo</th>
</tr>
</thead>
<tbody>
<c:forEach items="${personas}" var="item">
<tr>
<td>${item.personaId}</td>
<td>${item.name}</td>
<td>${item.gender}</td>
</tr>
</c:forEach>
</tbody>
</table>
</body>
</html>