title: Why doesn't String.equals() method work inside the JSTL Core tag <c:if>?
body: <p>Purpose of code: To validate an input string from the user. If the user inputs his name, stored as 'n', as "James" then the message "Validated!" is displayed. 
  (A separate HTML form takes care of the input string)</p>
  
  <p>Although there aren't any errors, the test inside the  tag fails and the message is not displayed regardless of whether the input string is "James" or not.</p>
  
  <pre><code>&lt;body&gt;
  
      &lt;%  String n = (String)request.getParameter("n");
             String t = "James";
      %&gt;
  
      Message &lt;!-- Default message displayed to show that HTML body is read. --&gt;
  
      &lt;c:if test="${t.equals(n)}"&gt; 
          &lt;c:out value="Validated!"/&gt;
      &lt;/c:if&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>If I were to replace the test condition with true inside the curly braces, the if condition passes and the message "Validated!" is displayed.</p>
  
  <p>Why doesn't the <code>equals()</code> method work inside the JSTL tag?</p>