【发布时间】:2016-12-08 16:25:11
【问题描述】:
那里的文本字段由 Chrome 填充,但是当我使用该信息进行登录过程时,就像没有数据一样。我必须重写文本字段中的所有信息。我希望将此信息用于登录过程。 我该怎么做?
控制器类:
public class LoginController extends SelectorComposer<Component>{
//Wire Components
@Wire
private Textbox user;
@Wire
private Textbox password;
@Wire
private Label message;
private AuthenticationService serviceAuth = new AuthenticationService();
/*
* Method: doLogin
* Details: Login function with the data provided: User and password
*
*/
@Listen("onClick=#loginButton")
public void doLogin(){
String userName = user.getValue();
String pass = password.getValue();
//Now we use the Authenthication service
if(!serviceAuth.login(userName, pass)){
message.setValue("Datos ingresados son incorrectos");
return;
}
UserCredential tmpCred = serviceAuth.getUserCredential(); //check
message.setValue("Bienvenido, "+userName);
Executions.sendRedirect("/inquiries.zul");
}
}
【问题讨论】: