Skip to main content

how to catch the exception with ajax request in jsf2.0.2?

1 reply [Last post]
wuarron
Offline
Joined: 2007-09-13
Points: 0

how to catch the exception with ajax request in jsf2.0.2?
In the sun jsf imp PartialViewContextImpl class:

....

} else if (curPhase == PhaseId.RENDER_RESPONSE) {

PartialResponseWriter writer = ctx.getPartialViewContext().getPartialResponseWriter();

writer.startUpdate(comp.getClientId(ctx));
try {
// do the default behavior...
comp.encodeAll(ctx);
}
catch (Exception ce) {
if (LOGGER.isLoggable(Level.SEVERE)) {
LOGGER.severe(ce.toString());
}
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE,
ce.toString(),
ce);
}
}
writer.endUpdate();
}

...

l see. not catch the exception when render.how can i catch the exception occur when render?

when ajax request,an error occurred while normal.

Message was edited by: wuarron

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vesuvius
Offline
Joined: 2007-06-02
Points: 0

Perhaps the following blog entry can help you:
http://weblogs.java.net/blog/edburns/archive/2009/09/03/dealing-graceful...

Ed Burns gives an example of an ExceptionHandler.