title: when i am running the following code ...I am getting an error
body: <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org    /TR/html4/loose.dtd"&gt;
  &lt;%@ page import="java.sql.*" %&gt;
  &lt;%@ page import="java.io.*" %&gt;
  
  &lt;HTML&gt;
  &lt;HEAD&gt;
      &lt;TITLE&gt;Login &lt;/TITLE&gt;
  &lt;/HEAD&gt;
  
  &lt;BODY bgcolor="#ffffcc"&gt;
    &lt;font size="+3" color="red"&gt;&lt;br&gt;Welcome !!!!&lt;/font&gt;
    &lt;FORM action="" method="get"&gt;
      &lt;TABLE style="background-color: #ECE5B6;" WIDTH="30%" &gt;
  
        &lt;TR&gt;
            &lt;TH width="50%"&gt;id&lt;/TH&gt;
            &lt;TD width="50%"&gt;&lt;INPUT TYPE="text" NAME="id1"&gt;&lt;/TD&gt;
        &lt;/tr&gt;
  &lt;TR&gt;
      &lt;TH width="50%"&gt;password&lt;/TH&gt;
   &lt;TD width="50%"&gt;&lt;INPUT TYPE="password" NAME="pass1"&gt;&lt;/TD&gt;
    &lt;/tr&gt;
  
    &lt;TR&gt;
        &lt;TH&gt;&lt;/TH&gt;
        &lt;TD width="50%"&gt;&lt;INPUT TYPE="submit" VALUE="submit"&gt;&lt;/TD&gt;
    &lt;/tr&gt;
     &lt;/TABLE&gt;
  
  &lt;%
     String id = request.getParameter("id1");
     String  pass= request.getParameter("pass1");
  
     String connectionURL ="jdbc:mysql://localhost/test";
     Connection connection = null;
  
  
     Class.forName("com.mysql.jdbc.Driver").newInstance();
     int updateQuery = 0;
     if(id!=null &amp;&amp; pass!=null){
     if(id!="" &amp;&amp; pass!="" ){
     try {
         connection = DriverManager.getConnection(connectionURL,"root","dhawanbhai1");
  
     Statement st=connection.createStatement();
     ResultSet rs=st.executeQuery("select id,password from userpass");  
        while(rs.next())  
             {  
             String username=rs.getString(1);  
             String password=rs.getString(2);  
             if(id.equals(username) &amp;&amp; pass.equals(password)){  
                 session.setAttribute("username",id);  
                 response.sendRedirect("http://localhost:8081/LoginExample/Welcome.jsp");  
             }  
                     else{  
                 response.sendRedirect("http://localhost:8081/LoginExample/LoginError.jsp");  
                     }  
         }  
    }            
                     catch (Exception ex) {
         out.println("Unable to connect to database.");
         }
         finally {
             pstatement.close();
             connection.close();
              }
  
  
  %&gt;
    &lt;/FORM&gt;
   &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>Error :
  HTTP Status 500 - Unable to compile class for JSP: </p>
  
  <hr>
  
  <p>type Exception report
  message Unable to compile class for JSP: 
  description The server encountered an internal error that prevented it from fulfilling this request.
  exception 
  org.apache.jasper.JasperException: Unable to compile class for JSP: </p>
  
  <p>An error occurred at line: [40] in the generated java file: [C:\Users\jabaraku\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\LoginExample\org\apache\jsp\LoginPage_jsp.java]
  Syntax error, insert "}" to complete ClassBody</p>
  
  <p>An error occurred at line: [149] in the generated java file: [C:\Users\jabaraku\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\LoginExample\org\apache\jsp\LoginPage_jsp.java]
  Syntax error, insert "else Statement" to complete IfStatement</p>
  
  <p>An error occurred at line: [149] in the generated java file: [C:\Users\jabaraku\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\LoginExample\org\apache\jsp\LoginPage_jsp.java]
  Syntax error, insert "}" to complete Block</p>
  
  <p>An error occurred at line: [149] in the generated java file: [C:\Users\jabaraku\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\LoginExample\org\apache\jsp\LoginPage_jsp.java]
  Syntax error, insert "else Statement" to complete IfStatement</p>
  
  <p>An error occurred at line: [149] in the generated java file: [C:\Users\jabaraku\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\LoginExample\org\apache\jsp\LoginPage_jsp.java]
  Syntax error, insert "}" to complete Block</p>
  
  <p>An error occurred at line: [161] in the generated java file: [C:\Users\jabaraku\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\LoginExample\org\apache\jsp\LoginPage_jsp.java]
  Syntax error on token "}", delete this token</p>
  
  <p>Stacktrace:
      org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
      org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
      org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
      org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
  note The full stack trace of the root cause is available in the Apache Tomcat/7.0.47 logs.</p>
  
  <hr>
  
  <p>Apache Tomcat/7.0.47</p>