-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hello folks we have implemented in our APP the Open Session in view pattern everything works like expected but our APP sometimes throws some errors on commit my question is how i publish those error to the client.. take a look what i have try so far.
1). throw a Business Exception but is not throw to the client.
2). show a messageBox throws java.lang.IllegalStateException: UI can't be modified in the rendering phase
3). open a modal window with the message throws java.lang.IllegalStateException: UI can't be modified in the rendering phase
the exception is being logged to the server log but the client is unaware that the exception ever exist and is causing some headaches to us.
here is some code.
public void cleanup(Execution exec,Execution parent,List<Throwable>errs)
{
HibernateSessionsUtil sessionsUtils = (HibernateSessionsUtil)SpringUtil.getBean("sessionsUtils");
if (parent == null)
if (errs == null || errs.isEmpty())
{
try{sessionsUtils.currentSession().getTransaction().commit();}catch(Exception e)
{log.error(e.getMessage());final Throwable ex=(Throwable)e;rollback(exec,ex);showErrorMessage(e);}
} else
{
final Throwable ex = errs.get(0);
rollback(exec,ex);
showErrorMessage(ex);
}
}
}
here is the method which shows the error to client [pretend to show it]
private void showErrorMessage(Throwable error)
{
StringBuilder message = ...............................................................
windowHelper.openModalWindow("........commiterror.zul",message);
return;
}
please help me thanks a lot.
Asked: 2013-08-01 13:38:05 +0800
Seen: 7 times
Last updated: Aug 01 '13