Results 1 to 2 of 2
- 08-07-2007, 02:05 AM #1
Member
- Join Date
- Jul 2007
- Posts
- 40
- Rep Power
- 0
Error: javax.servlet.ServletException: Column not found
Hi. Login.html page is what user use to login which, will take him to validateform.jsp page, in order to check if the user is a register user to have access to the page. Then, the UsePage.jsp is a welcome page that's, if successfully. But the error that i encounter after using Deploytool is
My table name is Registration.Java Code:HTTP STATUS 500 javax.servlet.ServletException: Column not found org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:830) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:763) org.apache.jsp.ValidateForm_jsp._jspService(ValidateForm_jsp.java:103) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105) javax.servlet.http.HttpServlet.service(HttpServlet.java:860) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247) javax.servlet.http.HttpServlet.service(HttpServlet.java:860) sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:517) org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282) org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165) PLEASE REPLY KELLY(NIIT Student). Remain Bless All Developers Amen. snookcent@yahoo.com, iykelly4love@yahoo.co.uk
Columns are DbUserName and DbPassword.
ValidateForm.jspXML Code:Login.html (Login Page) <html> <head><title>Please Sign in</title></head> <h2>Please Login</h2> <body> <form method="post" action="http://localhost:8080/valid/ValidateForm.jsp"> <tr> <td>UserName:</td> <td><input type="text" name="username"></td> </tr><br> <tr> <td>password:</td> <td><input type="password" name="password"></td> </tr><br> <tr> <td><input type="submit" value="Login"></td> </tr> </form> </body> </html>
UsePage.jspJava Code:<html> <head> <title>login validator</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <%@ page import="javax.servlet.*" %> <%@ page import="javax.servlet.http.*" %> <%@ page import="java.sql.*" %> <body> <% Connection con = null; String username = request.getParameter("username"); String password = request.getParameter("password"); String DbPassword = ""; String DbUserName=""; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:KellySource", "java", "javaclass"); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("select * from Registration"); while(rs.next()) { DbUserName=rs.getString(username); DbPassword = rs.getString(password); } if (username.equals(DbUserName) && password.equals(DbPassword)) { } else { } } finally { con.close(); } response.sendRedirect("UsePage.jsp"); %> </body> </html>
Thanks.Java Code:<html> <head><title>You have Successfully Login</title></head> <body bgcolor=bluelight> <h2>You have Successfully Login</h2> </body> </html>
- 08-07-2007, 07:20 AM #2
Member
- Join Date
- Jul 2007
- Posts
- 40
- Rep Power
- 0
Problem is here..
The code should be actuallyJava Code:DbUserName=rs.getString(username); DbPassword = rs.getString(password); replace it with DbUserName=rs.getString(1); DbPassword = rs.getString(2); Or DbUserName=rs.getString("DbUserName"); DbPassword = rs.getString("DbPassword");
Java Code:String username = request.getParameter("username"); String password = request.getParameter("password"); while(rs.next()) { DbUserName=rs.getString(1); DbPassword = rs.getString(2); if (username.equals(DbUserName) && password.equals(DbPassword)) { } else { } }
Similar Threads
-
Error: no class definition found
By toby in forum New To JavaReplies: 6Last Post: 08-28-2011, 10:32 PM -
javax.servlet.ServletException:Can't get definitions factory
By Peter in forum JavaServer Faces (JSF)Replies: 3Last Post: 12-02-2008, 07:29 AM -
Error: incompatible types, found: int required: boolean
By silvia in forum New To JavaReplies: 6Last Post: 10-08-2008, 08:09 AM -
javax.servlet.ServletException: Wrapper cannot find servlet class util.t2
By osval in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 03:47 PM -
Error: javax.swing.AbstractButton cannot be applied to...
By barney in forum AWT / SwingReplies: 1Last Post: 08-01-2007, 06:10 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks