It's caused because the page is cached. It still has the old "Users"
object with the values filled in the first time. Something like the
following will fix (I personally user a getter with lazy initialization,
and initialize users to null):
public void initialize() {
Users users = new Users();
}
Joel
-----Original Message-----
From: Java Leech [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 12, 2005 9:25 AM
To: [email protected]
Subject: Newbie with Thread Issues
I have posted this on the forum but it seems there is not to much action
there. So I'll try the mailing list.
I'm not sure what I am doing wrong but I seem to be having some serious
thread problems. I have been developing an app for about a week and
today was the first time I brought up a browser on another machine to my
webapp. I knew something was wrong immediatly when my login form was
autofilled with the values that I used in the first browser.
After trying to log in got a bunch of null value exceptions and can't
ever log back in with out restarting jboss. I am using Hibernate3 and
Tapestry 3.03 running on jboss.
Here is a code snippet from my login component:
public abstract class NavLogin extends BaseComponent implements IForm{
private ICallback callback;
private Users users = new Users();
public void setCallback(ICallback callback) {
this.callback = callback;
}
public void formSubmit(IRequestCycle cycle){
//Form Validation
ValidationDelegate delegate =
(ValidationDelegate)getBeans().getBean("delegate");
//If no errors add the user
if(!delegate.getHasErrors()){
System.err.println("Users: "+ getUsers().getEmail() +
" Logging in with password: "+
HashUtils.md5Sum(getUsers().getPassword()));
Users authUser = authenticate();
if(authUser != null){
Visit visit = (Visit) getPage().getVisit();
visit.setUsers(authUser);
if(authUser.getRole().getType().equalsIgnoreCase("provider")){
cycle.activate("CompanyProfile");
}
}
}
}
/**
* Authenticate the user attempting to log in
* @return
*/
public Users authenticate(){
UserDAO dao = new UserDAO();
Users aUser = dao.authUser(getUsers().getEmail(),
HashUtils.md5Sum(getUsers().getPassword()));
return(aUser);
}
--
http://www.fastmail.fm - The professional email service
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]