Jay Roy
asked on
show backend error on Flex side
higuys
I have a application which submits an email.
this is the flex code
public function sendEmail(event:CloseEvent ):void{
workflocomponent.sendEmail (); // this makes a remote java call
My requirment is the following
if(email has been sent sucessfully) {
statusSent.text = "Email has been sent";
}
else if (email has not been sent){
statusError.text = "some error. Contact System Admin."
}
}
<mx:Label id = 'statusSent' fontWeight = 'bold' color = 'green'/>
<mx:Label id = 'statusError' fontWeight = 'bold' color = 'red'/>
This is my simple java method sendEmail() which is invoked by the above flex code
public void sendEmail() throws Exception{
Properties props = new Properties();
props.put("mail.smtp.host" , host);
try {
Transport.send(simpleMessa ge);
} catch (MessagingException e)
{
logger.error("Excpetion thrown in SendEmail.send():"+e.getMessage());
}
}
I am able to see the error message e.getMessage() in the catch block in java:
catch (MessagingException e) {
logger.error("Excpetion thrown in SendEmail.send():"+e.getMe ssage());
}
I just want to pass the e.getMessage() to flex side. Any ideas?
thanks
I have a application which submits an email.
this is the flex code
public function sendEmail(event:CloseEvent
workflocomponent.sendEmail
My requirment is the following
if(email has been sent sucessfully) {
statusSent.text = "Email has been sent";
}
else if (email has not been sent){
statusError.text = "some error. Contact System Admin."
}
}
<mx:Label id = 'statusSent' fontWeight = 'bold' color = 'green'/>
<mx:Label id = 'statusError' fontWeight = 'bold' color = 'red'/>
This is my simple java method sendEmail() which is invoked by the above flex code
public void sendEmail() throws Exception{
Properties props = new Properties();
props.put("mail.smtp.host"
try {
Transport.send(simpleMessa
} catch (MessagingException e)
{
logger.error("Excpetion thrown in SendEmail.send():"+e.getMessage());
}
}
I am able to see the error message e.getMessage() in the catch block in java:
catch (MessagingException e) {
logger.error("Excpetion thrown in SendEmail.send():"+e.getMe
}
I just want to pass the e.getMessage() to flex side. Any ideas?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.