algarpe
4 Oct 2007, 7:04 AM
Hi everybody,
I'm trying to complete my login script, but I don't know how to read the XML response from my jsp page :((. My code is based in another one which reads from a JSON. I'm blocked at the handler function which gets the XML response.
My code:
hiddenForm.submit({
waitTitle: 'Accessing',
waitMsg: 'Please wait...',
url: 'login.jsp',
method: 'POST',
success: fsws,
failure: fswf,
params:{
user: user.getValue(),
pwd: enpwd
}
});
fsws = function(f,a){
if (!a || !a.result || !a.result.user){
Ext.MessageBox.alert(_title, "Error: didn't get the awaited result!");
return;
}
res = a.xmlData;
}
fswf = function(f,a){
if (a && a.result && a.result.msg) {
Ext.MessageBox.alert("", a.result.msg);
} else {
Ext.MessageBox.alert("", "Didn't finish the athentication process!");
}
}
The other code, in fsws took values like this: a.result.user
How can I get it from a XML like this one?
<response success="true"><login>OK</login><user>user</user><password>pwd</password></response>
Anyone can help me?
Thanks very much =;
Bye
I'm trying to complete my login script, but I don't know how to read the XML response from my jsp page :((. My code is based in another one which reads from a JSON. I'm blocked at the handler function which gets the XML response.
My code:
hiddenForm.submit({
waitTitle: 'Accessing',
waitMsg: 'Please wait...',
url: 'login.jsp',
method: 'POST',
success: fsws,
failure: fswf,
params:{
user: user.getValue(),
pwd: enpwd
}
});
fsws = function(f,a){
if (!a || !a.result || !a.result.user){
Ext.MessageBox.alert(_title, "Error: didn't get the awaited result!");
return;
}
res = a.xmlData;
}
fswf = function(f,a){
if (a && a.result && a.result.msg) {
Ext.MessageBox.alert("", a.result.msg);
} else {
Ext.MessageBox.alert("", "Didn't finish the athentication process!");
}
}
The other code, in fsws took values like this: a.result.user
How can I get it from a XML like this one?
<response success="true"><login>OK</login><user>user</user><password>pwd</password></response>
Anyone can help me?
Thanks very much =;
Bye