This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

bean error

 
jyotsana dang
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..
i have a slight error that comes up in the bean page..
made a login html that calles a process.jsp file ..
<%@ page import="java.util.*" %<
<jsp:useBean id="user" class="Login" scope="request"<
<<jsp:setProperty name="user" property="*"/<
</jsp:useBean<
<%
if (idHandler.validate()) {
%<
<jsp:forward page="success.jsp"/<
<%
} else {
%<
<jsp:forward page="retry.jsp"/<
<%
}
%<
and the login file is :

import java.sql.*;
public class Login {
private String username = "";
private String password = "";
public Login() {
}
public void setUsername(String username) {
this.username = username;
}
public void setPassword(String password) {
this.password = password;
}

public boolean authenticate(String username2,
String password2) {
String query="select user_login,user_pwd from personal_info;";
String DbUserName="";
String DbPassword="";
String finalUser="";
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc dbc:mech_iit");
Statement stat=con.createStatement();
ResultSet rst=stat.executeQuery(query);
while(rst.next())
{
DbUserName=rst.getString("UserName");
DbPassword=rst.getString("password");
if (username2.equals(DbUserName) &&
password2.equals(DbPassword)) {
break;
}

}
return true;
}catch(Exception e){
e.printStackTrace();
return false;
}
}}
now when i try to run it in the explorer :
it gives the foll. errors:
An error occurred at line: 1 in the jsp file: /mech_iit/process.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\mech_iit\process_jsp.java:43: cannot resolve symbol
symbol : class Login
location: class org.apache.jsp.process_jsp
Login user = null;
An error occurred at line: 1 in the jsp file: /mech_iit/process.jsp
Generated servlet error:
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\mech_iit\process_jsp.java:45: cannot resolve symbol
symbol : class Login
location: class org.apache.jsp.process_jsp
user = (Login) pageContext.getAttribute("user", PageContext.SESSION_SCOPE);
^
An error occurred at line: 1 in the jsp file: /mech_iit/process.jsp
Generated servlet error:
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\mech_iit\process_jsp.java:48: cannot resolve symbol
symbol : class Login
location: class org.apache.jsp.process_jsp
user = (Login) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "Login");
^
can anyone be kind enough to tell me where have i gone wrong?
jyotsana
 
It's just a flesh wound! Or a tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!