title: Passing JSP Parameters, then checking if they exist
body: <p>I have a situation, where I am working with multiple JSP includes, and in the root file that calls these includes I am setting a list of parameters. But there are, in some instances where not all of the parameters are used, so the parameters are never set.  I would like to create a conditional statement that checks if the parameter is set, and if not, then don't display its placeholder at all.  Here's my code:</p>
  
  <p>index.jsp</p>
  
  <pre><code>&lt;jsp:include page="include.jsp"&gt;
       &lt;jsp:param name="title" value="Title of Product"/&gt;
       &lt;jsp:param name="instructor" value="Some Donkus"/&gt;
       &lt;jsp:param name="artist" value=""/&gt;
       &lt;jsp:param name="album" value=""/&gt;
  &lt;/jsp:include&gt;
  </code></pre>
  
  <p>include.jsp</p>
  
  <pre><code>&lt;ul&gt;
  &lt;c:if test="${!empty param.title}"&gt;
       &lt;li class="instructor"&gt;Title:&amp;nbsp;&lt;span&gt;&lt;%= request.getParameter("title") %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;/c:if&gt;
  &lt;c:if test="${!empty param.instructor}"&gt;
       &lt;li class="instructor"&gt;Instructor:&amp;nbsp;&lt;span&gt;&lt;%= request.getParameter("instructor") %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;/c:if&gt;
  &lt;c:if test="${!empty param.artist}"&gt;
       &lt;li class="instructor"&gt;Artist:&amp;nbsp;&lt;span&gt;&lt;%= request.getParameter("artist") %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;/c:if&gt;
  &lt;c:if test="${!empty param.album}"&gt;
       &lt;li class="instructor"&gt;Album:&amp;nbsp;&lt;span&gt;&lt;%= request.getParameter("album") %&gt;&lt;/span&gt;&lt;/li&gt;
  &lt;/c:if&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Current Result:</p>
  
  <ul>
  <li><strong>Title:</strong>     Title of Product</li>
  <li><strong>Instructor:</strong>     Some Donkus</li>
  <li><strong>Artist:</strong></li>
  <li><strong>Album:</strong></li>
  </ul>
  
  <p>I can get the include.jsp to populate correctly, but even though <strong>ARTIST</strong> and <strong>ALBUM</strong> are blank, their list items still show up.  What am I doing wrong here?</p>