[]'s
Rafael
I make a RPC call in the login callback. Simplest case is to create a
RPC servlet that takes a username and password and returns a boolean
if a session was established. A more compilated service will return
error messages and maybe any initialization objects that are needed
right after login.
--
Sandy McArthur
"He who dares not offend cannot be honest."
- Thomas Paine
Thanks
On 18 abr, 18:44, "Sandy McArthur" <sandy...@gmail.com> wrote:
final LoginServiceAsync loginService = LoginService.App.getInstance();
loginService.doLogin(username, password, new AsyncCallback() {
public void onSuccess(final Object result) {
final LoginResult loginResult = (LoginResult)result;
if (loginResult.isSuccess()) {
// Do your post login initialization
myApp.loadMainView(username);
} else {
// Login failed, try again
loginPanel.setErrorMessage(loginResult.getErrorMessage());
loginPanel.reenable();
}
}
public void onFailure(final Throwable caught) {
loginPanel.setErrorMessage(caught.getMessage());
loginPanel.reenable();
}
});
}
}
Does that help? I'm not sure what is unclear. It's just like anything
else you'd do with RPC in GWT.
I have no idea what "I wanna set the user and pass by database" means
from your other message.
On 4/18/07, rafaelt <clar...@gmail.com> wrote:
>
On 18 abr, 20:04, "Sandy McArthur" <sandy...@gmail.com> wrote:
> class MyLoginListener extends LoginListener {
> public void onSubmit(final LoginPanel loginPanel) {
> final String username = loginPanel.getUserame();
> final String password = loginPanel.getPassword();
>
> final LoginServiceAsync loginService = LoginService.App.getInstance();
>
> loginService.doLogin(username, password, new AsyncCallback() {
> public void onSuccess(final Object result) {
> final LoginResult loginResult = (LoginResult)result;
>
> if (loginResult.isSuccess()) {
> // Do your post login initialization
> myApp.loadMainView(username);
> } else {
> // Login failed, try again
> loginPanel.setErrorMessage(loginResult.getErrorMessage());
> loginPanel.reenable();
> }
> }
>
> public void onFailure(final Throwable caught) {
> loginPanel.setErrorMessage(caught.getMessage());
> loginPanel.reenable();
> }
> });
> }
>
> }
>
> Does that help? I'm not sure what is unclear. It's just like anything
> else you'd do with RPC in GWT.
>
> I have no idea what "I wanna set the user and pass by database" means
> from your other message.
>
> On 4/18/07, rafaelt <clarov...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Sandy do you have a example code for that???
>
> > Thanks
>
> > On 18 abr, 18:44, "Sandy McArthur" <sandy...@gmail.com> wrote:
> > > On 4/18/07, rafaelt <clarov...@gmail.com> wrote:
>
> > > > I would like know how I can validate a login??? Can you give to me a
> > > > example of validation???
>
> > > I make a RPC call in the login callback. Simplest case is to create a
> > > RPC servlet that takes a username and password and returns a boolean
> > > if a session was established. A more compilated service will return
> > > error messages and maybe any initialization objects that are needed
> > > right after login.
>
> > > --
> > > Sandy McArthur
>
> > > "He who dares not offend cannot be honest."
> > > - Thomas Paine
>
> --
> Sandy McArthur
>
> "He who dares not offend cannot be honest."
> - Thomas Paine- Ocultar texto entre aspas -
>
> - Mostrar texto entre aspas -