title: JSTL and c:when test condition
body: <p>how can I check and use userLoggedIn to testify the condition.
  I am new and I have search alot. there must be a silly mistake.</p>
  
  <p>index.jsp</p>
  
  <pre><code>&lt;div id="sign-in"&gt;
      &lt;c:choose&gt; 
          &lt;c:when test="${userLoggedIn == 1}"&gt; 
               Welcome &lt;c:out value="${loginID}" /&gt; | Logout
          &lt;/c:when&gt;
          &lt;c:otherwise&gt;Log-in&lt;/c:otherwise&gt;
      &lt;/c:choose&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>some verification servlet </p>
  
  <pre><code>int userLoggedIn = 0;
  
  if(loginID.equals("guest@guest.com") &amp;&amp; password.equals("guest")){
      userLoggedIn = 1;
      getServletContext().getRequestDispatcher("/index.jsp").forward(request, response);
      //     out.println("login successful");
  
  } else {
      //   getServletContext().getRequestDispatcher("/login.jsp").forward(request, response);
      out.println("login failed");
  }
  </code></pre>