title: How to use javascript alert() in .jsp file?
body: <p>I wrote a login form: First, you enter your email and password, then there's a checking to check your spelling of email and password. After that, the program runs to .jsp file to check if the user exists. If it exists, it sends the user/ admin to the homepage, else, it returns the guest to the login form. I want to add an alert says "Welcome user/admin" or "User doesn't exist". I tried this:</p>
  
  <pre><code> if (session.getAttribute("Status")==("admin"))
      {
          alert("Welcome admin!");
          response.sendRedirect ("newindex.jsp");
      }
      else if (session.getAttribute("Status")==("user"))
      {
          alert("Welcome user!");
          response.sendRedirect ("newindex.jsp");
      }   
      else
      {
          alert("user doesn't exist");
          response.sendRedirect ("form2.html");
      }
  </code></pre>
  
  <p>How can I alert those messeges?</p>