From: Niels Erik G. Nielsen Date: Fri, 1 Mar 2013 00:45:49 +0000 (-0500) Subject: Removes non-generic elements from utility package X-Git-Tag: v0.0.7~225 X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=commitdiff_plain;ds=sidebyside;h=4902142157b8b64a5ed0daaa4b06fd0f86c55075;hp=1724e77234e35c61de392b943730b76771ce5bb3;p=mkjsf-moved-to-github.git Removes non-generic elements from utility package --- diff --git a/src/META-INF/faces-config.xml b/src/META-INF/faces-config.xml index 8e033da..a7b9df0 100644 --- a/src/META-INF/faces-config.xml +++ b/src/META-INF/faces-config.xml @@ -3,8 +3,4 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd" version="2.1"> - - - com.indexdata.pz2utils4jsf.exceptions.CustomExceptionHandlerFactory - \ No newline at end of file diff --git a/src/main/java/com/indexdata/pz2utils4jsf/exceptions/CustomExceptionHandler.java b/src/main/java/com/indexdata/pz2utils4jsf/exceptions/CustomExceptionHandler.java deleted file mode 100644 index 048ef05..0000000 --- a/src/main/java/com/indexdata/pz2utils4jsf/exceptions/CustomExceptionHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.indexdata.pz2utils4jsf.exceptions; - -import java.util.Iterator; - -import javax.faces.FacesException; -import javax.faces.application.NavigationHandler; -import javax.faces.application.ViewExpiredException; -import javax.faces.context.ExceptionHandler; -import javax.faces.context.ExceptionHandlerWrapper; -import javax.faces.context.FacesContext; -import javax.faces.event.ExceptionQueuedEvent; -import javax.faces.event.ExceptionQueuedEventContext; - -public class CustomExceptionHandler extends ExceptionHandlerWrapper { - - private ExceptionHandler wrapped; - - public CustomExceptionHandler (ExceptionHandler wrapped) { - this.wrapped = wrapped; - } - - @Override - public ExceptionHandler getWrapped() { - return this.wrapped; - } - - @Override - public void handle() throws FacesException { - for (Iterator i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { - ExceptionQueuedEvent event = i.next(); - ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource(); - Throwable t = context.getException(); - if (t instanceof ViewExpiredException) { - // ViewExpiredException vee = (ViewExpiredException) t; - FacesContext fc = FacesContext.getCurrentInstance(); - // Map requestMap = fc.getExternalContext().getRequestMap(); - NavigationHandler nav = fc.getApplication().getNavigationHandler(); - context.getContext().getPartialViewContext().setRenderAll(true); - try { - nav.handleNavigation(fc, null, "search"); - fc.renderResponse(); - } finally { - i.remove(); - } - } - } - getWrapped().handle(); - } -} diff --git a/src/main/java/com/indexdata/pz2utils4jsf/exceptions/CustomExceptionHandlerFactory.java b/src/main/java/com/indexdata/pz2utils4jsf/exceptions/CustomExceptionHandlerFactory.java deleted file mode 100644 index ee60210..0000000 --- a/src/main/java/com/indexdata/pz2utils4jsf/exceptions/CustomExceptionHandlerFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.indexdata.pz2utils4jsf.exceptions; - -import javax.faces.context.ExceptionHandler; -import javax.faces.context.ExceptionHandlerFactory; - -public class CustomExceptionHandlerFactory extends ExceptionHandlerFactory { - - private ExceptionHandlerFactory parent; - - public CustomExceptionHandlerFactory (ExceptionHandlerFactory parent) { - this.parent = parent; - } - @Override - public ExceptionHandler getExceptionHandler() { - ExceptionHandler result = parent.getExceptionHandler(); - result = new CustomExceptionHandler(result); - return result; - } - -}