title: Struts <logic:notEmpty> not working or bean property not being written properly to JSP?
body: <p>I'm beginning on bug fixes for a program with which I have little familiarity. I've changed a section of code on one of the JSPs. I need it to print names with either of the two following formats (depending on whether or not the middle name property exists):</p>
  
  <blockquote>
    <p>LastName, FirstName M.</p>
    
    <p>LastName, FirstName</p>
  </blockquote>
  
  <p>I believe my code should print the middle initial and the period if and only if that property exists, but for each name in the list, it prints:</p>
  
  <blockquote>
    <p>LastName, FirstName .</p>
  </blockquote>
  
  <p>It prints either no middle initial or a middle initial that is an empty string, followed by the period.</p>
  
  <p>The relevant code is as follows:</p>
  
  <pre><code>&lt;html:link styleClass="recordLink" action="/secure/admin/users?actionMethod=details" paramId="userId" paramName="users" paramProperty="userId"&gt;
      &lt;bean:write name="users" property="lastName"/&gt;,
      &lt;bean:write name="users" property="firstName"/&gt;
      &lt;logic:notEmpty name="users" property="middleName"&gt;
          &lt;bean:write name="users" property="middleName"/&gt;.
      &lt;/logic:notEmpty&gt;
  &lt;/html:link&gt;
  </code></pre>
  
  <p>Why is the <code>&lt;logic:notEmpty&gt;</code> tag not working? Could the <code>middleName</code> property be determined to be non-empty if the property doesn't exist? Is there something wrong with my syntax?</p>
  
  <p>I've also tried to use JSTL tags, but I could not get it working in OC4J (Error: "<a href="http://java.sun.com/jsp/jstl/core" rel="nofollow">http://java.sun.com/jsp/jstl/core</a>" is not a registered TLD namespace.)</p>