title: Can jsp:param store a collection?
body: <p>Greetings, here is the problem. I have a page called <strong>entList.jsp</strong>, that works with a collection:</p>
  
  <pre><code>&lt;c:forEach var = "pack" items = "${packingList}"&gt;
  &lt;!--Here goes something with outputting the pack instance in a required format--&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>Everything works great, and the parameter <strong>packingList</strong> is passed as an attribute of the request by the action handler that calls this page. Actually <strong>packingList</strong> is of type <em>Collection&lt;GenericBean&gt;</em>. </p>
  
  <p>It turned out that this page (the fragment it stores) is actually pretty useful, and can be used in many places with different collections. So I tried to include this page like this (in another page):</p>
  
  <pre><code>&lt;jsp:include page="entList.jsp"&gt;
    &lt;!-- Pass the required collection as a parameter--&gt;
    &lt;jsp:param name = "packingList" value = "${traffic.packingList}"/&gt;
  &lt;/jsp:include&gt;
  </code></pre>
  
  <p>However, now this fragment does not see the argument <strong>packingList</strong>. I tried to rewrite the fragment like this (since now it's a parameter):</p>
  
  <pre><code>&lt;c:forEach var = "pack" items = "${param.packingList}"&gt;
  &lt;!--Here goes something with outputting the pack instance in a required format--&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>But now it generates an exception, since it treats <strong>packingList</strong> as a string and not a collection. So right now the solution is like this - set the required collection as an attribute in the action handler code:</p>
  
  <pre><code>// This is the original instance set by the action
  request.setAttribute("traffic", traffic);
  // And this is the additional one, to be used by entList.jsp
  request.setAttribute("packingList", traffic.getPackingList());
  </code></pre>
  
  <p>So the question is - can <strong>jsp:param</strong> tag receive a collection as it's value? I read the documentation for the JSP tags and it remains unclear - it seems like the only thing you can pass in such a way it's string parameters (or something that can be converted to string), but no complicated objects.</p>