title: sendRedirect() not working as expected
body: <p>I've this <code>Register.jsp</code> page which on page load, I want to check if a user is already logged in. So I've this code,</p>
  
  <pre><code>&lt;%
      String usertype = (String)session.getAttribute("usertype");
      if(usertype.equals("student")){
          response.sendRedirect("studenthome.jsp");
      }
      else if(usertype.equals("faculty")){
          response.sendRedirect("facultyhome.jsp");
      }       
  %&gt;
  </code></pre>
  
  <p>It works when a user is logged in(it redirects to <code>studenthome.jsp</code> if <code>usertype</code> equals <code>student</code> and redirects to <code>facultyhome.jsp</code> if <code>usertype</code> equals <code>faculty</code>), but when <code>usertype</code> is <code>null</code>, I just want to continue loading the page instead I get following error. What am I doing wrong here</p>