Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-07-2007, 03:05 AM
Member
 
Join Date: Jul 2007
Posts: 40
barney is on a distinguished road
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
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
My table name is Registration.
Columns are DbUserName and DbPassword.

HTML 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>
ValidateForm.jsp
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>
UsePage.jsp

Code:
<html> <head><title>You have Successfully Login</title></head> <body bgcolor=bluelight> <h2>You have Successfully Login</h2> </body> </html>
Thanks.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-07-2007, 08:20 AM
zoe zoe is offline
Member
 
Join Date: Jul 2007
Posts: 40
zoe is on a distinguished road
Problem is here..
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");
The code should be actually
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 { } }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
javax.servlet.ServletException: Wrapper cannot find servlet class util.t2 osval Advanced Java 1 08-07-2007 04:47 PM
Error: javax.swing.AbstractButton cannot be applied to... barney AWT / Swing 1 08-01-2007 07:10 AM
Error: no class definition found toby New To Java 4 07-27-2007 08:01 PM
Error: incompatible types, found: int required: boolean silvia New To Java 1 07-19-2007 08:33 PM
javax.servlet.ServletException:Can't get definitions factory Peter JavaServer Faces 2 07-04-2007 08:25 AM


All times are GMT +3. The time now is 08:10 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org