Discussions

Web tier: servlets, JSP, Web frameworks: JSp login page show error Urgent

  1. JSp login page show error Urgent (5 messages)

    Hi all, This is login page it shows error the following error plz. me its urgent. org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 35 in the jsp file: /login.jsp Generated servlet error: C:\Tomcat 5.0\work\Catalina\localhost\forum\org\apache\jsp\login_jsp.java:92: ')' expected { ^ An error occurred at line: 35 in the jsp file: /login.jsp Generated servlet error: C:\Tomcat 5.0\work\Catalina\localhost\forum\org\apache\jsp\login_jsp.java:107: ')' expected } ^ 2 errors ----------------------------------------------------------- Login.jsp Hi <%! try { Connection con = null; Class.forName("org.gjt.mm.mysql.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost/india","root", "prince"); Statement stmt=con.createStatement(); ResultSet rs=stmt.executeQuery(q); String q="select * from edu"; } if(username.equals("user")&&(password.equals("pass") { flag=true; break; } if(flag==true) { response.sendRedirect("index.html"); } else { response.sendRedirect("re-enter.jsp"); } catch(Exception e) { out.println("Error in database coneection :"+e.toString()); } %> This is Jsp page
  2. Your try block seem to be wrong: the catch element must come just after the end of the try block. Why do you start your scriptel with a !
  3. Re: JSp login page show error Urgent[ Go to top ]

    http://www.jsptut.com/ Now go, run along sonny ...
  4. Re: JSp login page show error Urgent[ Go to top ]

    This must be the worst jsp page I have ever seen, all categories! I hope that this isn't the original page that threw the compile error. In that case, you have more serious problems than that specific error. You really need to slow down and study how to write simple applications with regard to some sort of mvc structure (or just the simplest form of beans) with jsp. (Yes, there are more problems in the code generating compile errors than just the try/catch). /N
  5. Re: JSp login page show error Urgent[ Go to top ]

    Yup, this is the same character who keeps posting discussions with subjects like 'S' and 'SS'.
  6. Hi, The right parentheses is missing in if condition. if(username.equals("user")&&(password.equals("pass") change this line to if(username.equals("user")&&(password.equals("pass"))) & try it.