I load object userData
like below, to show it on JSP. (later it will be loaded from database) using Register()
method type GET
.
Next I fill another fields of userData
on JSP and click register.
Then method Register()
start again, but not use this same RegistrationAction
.
So e.g. attribute1
will be still 1 instead of 2.
Sample:
public class RegistrationAction extends ActionSupport{
int attribute1=0;
public String Register() throws Exception {
attribute1++;
if(request.getMethod().equals("GET")){ //load object to form
user=new UserData();
user.setName("lucas");
return NONE;
}
//else POST -> save()
}
}
So what I should do to start this same instance of action ?