Hi,
I am newbie. I am trying to write new login function which is not used
acegi.
- Wrote LoginAction class
public String login() {
System.out.println(person.getUsername());
System.out.println(person.getPassword());
PersonDaoHibernate pdh = new PersonDaoHibernate();
boolean valid = pdh.authentication(person.getUsername(),
person.getPassword());
System.out.println(valid);
return SUCCESS;
}
- In LoginAction, I have login fuction which is call authentication function
in PersonDaoHibernate Class
public boolean authentication(String username, String password) {
System.out.println(username);
System.out.println(password);
try {
List lists = getHibernateTemplate().find(
"from Person where username=?", username);
if (lists.isEmpty()) {
return false;
} else {
return true;
}
} catch (Exception ex) {
System.out.println(ex.toString());
return false;
}
}
The result is
user1
123
java.lang.NullPointerException
Thanks for any suggestion.
Regard,
Tony
--
View this message in context:
http://www.nabble.com/NullPointerException-when-try-to-retrieve-data-tf4248239s2369.html#a12089884
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]