Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. public class YourExceptionHandler extends FullAjaxExceptionHandler {
  2.  
  3. public YourExceptionHandler(ExceptionHandler wrapped) {
  4. super(wrapped);
  5. }
  6.  
  7. @Override
  8. public void handle() throws FacesException {
  9. Iterator<ExceptionQueuedEvent> events = getUnhandledExceptionQueuedEvents().iterator();
  10.  
  11. if (events.hasNext() && events.next().getContext().getException() instanceof AbortProcessingException) {
  12. return; // Ignore (and don't log).
  13. }
  14.  
  15. super.handle(); // Continue to FullAjaxExceptionHandler.
  16. }
  17.  
  18. }
  19.  
  20. public class YourExceptionHandlerFactory extends ExceptionHandlerFactory {
  21.  
  22. private ExceptionHandlerFactory wrapped;
  23.  
  24. public YourExceptionHandlerFactory(ExceptionHandlerFactory wrapped) {
  25. this.wrapped = wrapped;
  26. }
  27.  
  28. @Override
  29. public ExceptionHandler getExceptionHandler() {
  30. return new YourExceptionHandler(getWrapped().getExceptionHandler());
  31. }
  32.  
  33. @Override
  34. public ExceptionHandlerFactory getWrapped() {
  35. return wrapped;
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement