Quoting Hugo Palma <[EMAIL PROTECTED]>:
You have two ways of setting the currUser DAO:
1. Copy fields from one object to another.
Just add this to your code:
currUser.setUsername(user.getUsername);
currUser.setPassword(user.getPassword);
.....
You don't have to assign the currUser field. That will the done for you
by Tapestry.
2. Declare the ASO like this:
@ApplicationState(created=false)
private User currUser;
assign the field like this:
currUser = u;
In which case I am getting confused reading this thread because I have
not done it that way and it works (unlike that for the OP):
public class Index
{
...
@ApplicationState
private User user;
...
Object onSubmitFromLoginForm()
{
Class nextPage = null;
User authenticatedUser =
Security.getSecurity().authenticate(userName, password, session);
if (authenticatedUser != null)
{
if (authenticatedUser.getRole() == User.Role.admin)
{
nextPage = Administration.class;
}
else
{
nextPage = UserAdministration.class;
}
user= authenticatedUser;
}
else
...
So why does this work? Or am I getting myself confused - to me it
looks like my code and that of the OP work in the same way, and yet I
can see why it shouldn't work...
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]