title: Pass a generic List to a JSP tag
body: <p>I'm using JSP tags to encapsulate reusable front-end logic.</p>
  
  <p>I can successfully pass a complex object <code>com.example.Product</code> to a tag, but I'm having trouble passing a <code>List&lt;Product&gt;</code> to a tag.</p>
  
  <p>Here is my <code>product.tag</code>:</p>
  
  <pre><code>&lt;%@ attribute name="product" required="true" type="com.example.Product" %&gt;
  &lt;a href="/products/${product.id}/${product.slug}"&gt;${product.name}&lt;/a&gt;
  </code></pre>
  
  <p>I can use this on a JSP page like so:</p>
  
  <pre><code>&lt;%@ taglib tagdir="/WEB-INF/tags" prefix="h" %&gt;
  &lt;h:product product="${myProduct}"/&gt;
  </code></pre>
  
  <p>Now, I would like to create a tag to display a list of products. I'm stuck on how to describe the type in the attribute declaration:</p>
  
  <pre><code>&lt;%@ attribute name="products" required="true" type="???" %&gt;
  &lt;%@ taglib tagdir="/WEB-INF/tags" prefix="h" %&gt;
  &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%&gt;
  &lt;ul&gt;
  &lt;c:forEach items="${products}" var="product"&gt;
    &lt;li&gt;&lt;h:product product="${product}"/&gt;&lt;/li&gt;
  &lt;/c:forEach&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I've tried the following:</p>
  
  <ul>
  <li><code>List&lt;com.example.Product&gt;</code></li>
  <li><code>java.util.List&lt;com.example.Product&gt;</code></li>
  </ul>
  
  <p>Both yield the following error: <code>Unknown attribute type (java.util.List&lt;com.example.Product&gt;) for attribute products</code></p>
  
  <p>I'm sure there's just some syntax for how to describe a generic type in the attribute directive, but I can't find any examples.</p>