title: How to generate an alert box from java servlet to a HTML page?
body: <p>upwd --> refers the entered password in login page in HTML page named (index.html) </p>
  
  <p>rpwd --> refers retyped password in the login page in the same HTML page</p>
  
  <pre><code>    //--&gt;Code in servlet
      if(upwd.equals(rpwd))
       {
             //database connectivity of a login form 
       }
      else
       {
           response.sendRedirect("index.html");
            //index.html is the name of the html page where im redirecting. 
       }
  </code></pre>
  
  <p>Since I m doing the validation in the servlet.Now,how can I generate an alert box in HTML(index.html) stating that password didn't matched from Servelet.</p>