Olá...
Uso o Java Studio Creator, e tenho encontrado o seguinte problema...
tenho um data provider, mas preciso gravar os dados dele em sessionbeans e/ou requestbeans...
só que eu tenho setar o parâmetro da seguinte forma:public String botao_ok_action() throws Exception{
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
String strUsuario = (String)campo_user.getText();
String strSenha = (String)campo_pass.getText();
//RowKey rowkey = corresp_usrDataProvider.getRowKey("corresp_usr");
mostra_result.setText(corresp_usrDataProvider.getValue("nome"));
corresp_usrDataProvider.cursorFirst();
int i = 0;
int intTotalUsr = corresp_usrDataProvider.getRowCount();
int intFlag = 1;
while(i++<=intTotalUsr){
if((corresp_usrDataProvider.getValue("nome").equals(strUsuario)) && ((corresp_usrDataProvider.getValue("senha").equals(strSenha)))){
//this.getExternalContext().redirect("http://www.uol.com.br");
String nomeUser = (String)corresp_usrDataProvider.getValue("nome");
getSessionBean1().setIdUsuario("online");
getSessionBean1().setNomeUsuario(nomeUser);
getSessionBean1().setIdUser(corresp_usrDataProvider.getValue("id"));
mostra_result.setText(corresp_usrDataProvider.getValue("nome"));
corresp_usrDataProvider.cursorFirst();
intFlag = 0;
break;
}else{
//this.getExternalContext().redirect("http://www.terra.com.br");
mostra_result.setText("Este usu\341rio n\343o existe ou foi desabilitado!");
intFlag = 1;
}
corresp_usrDataProvider.cursorNext();
}
corresp_usrDataProvider.cursorFirst();
if(intFlag == 0){
return "sucesso";
}else{
return "erro";
}
}
Esse é meu código...
Só que na linha:
getSessionBean1().setIdUser(corresp_usrDataProvider.getValue("id"));
ele diz que não pode... e se eu converto isso pra string, ele não mostra nada...
Então, como faço eu para armazenar id do usuário em sessions / requests?!
Estou sendo muito burro?! :oops:
Valeu
:D
:D