<%-- 
    Document   : listado
    Created on : 06-jul-2018, 15:42:40
    Author     : armaf
--%>

<%@ 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>JSP Page</title>
    </head>
    <body>
        <table border="1">
            <tr>
                <th>Código</th>
                <th>Nombre</th>
                <th>Resistencia</th>
            </tr>
            <c:forEach var="material" items="${materiales}">
                <tr>
                    <td>${material.codigo}</td>
                    <td>${material.nombre}</td>
                    <td>${material.resistencia}</td>
                    <c:url var="uriEliminar" value="/mvc/material/delete/${material.codigo}" />
                    <td><a href="${uriEliminar}">Eliminar</a></td>
                </tr>
            </c:forEach>
        </table>
        <c:url var="uriNuevo" value="/mvc/material/add" />
        <a href="${uriNuevo}">Nuevo producto</a>
    </body>
</html>
