Removes non-generic elements from utility package
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Fri, 1 Mar 2013 00:45:49 +0000 (19:45 -0500)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Fri, 1 Mar 2013 00:45:49 +0000 (19:45 -0500)
src/META-INF/faces-config.xml
src/main/java/com/indexdata/pz2utils4jsf/exceptions/CustomExceptionHandler.java [deleted file]
src/main/java/com/indexdata/pz2utils4jsf/exceptions/CustomExceptionHandlerFactory.java [deleted file]

index 8e033da..a7b9df0 100644 (file)
@@ -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">
-
-  <factory>
-       <exception-handler-factory>com.indexdata.pz2utils4jsf.exceptions.CustomExceptionHandlerFactory</exception-handler-factory>
-  </factory>
 </faces-config>
\ 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 (file)
index 048ef05..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-package com.indexdata.pz2utils4jsf.exceptions;\r
-\r
-import java.util.Iterator;\r
-\r
-import javax.faces.FacesException;\r
-import javax.faces.application.NavigationHandler;\r
-import javax.faces.application.ViewExpiredException;\r
-import javax.faces.context.ExceptionHandler;\r
-import javax.faces.context.ExceptionHandlerWrapper;\r
-import javax.faces.context.FacesContext;\r
-import javax.faces.event.ExceptionQueuedEvent;\r
-import javax.faces.event.ExceptionQueuedEventContext;\r
-\r
-public class CustomExceptionHandler extends ExceptionHandlerWrapper {\r
-\r
-  private ExceptionHandler wrapped;\r
-  \r
-  public CustomExceptionHandler (ExceptionHandler wrapped) {\r
-    this.wrapped = wrapped;\r
-  }\r
-    \r
-  @Override\r
-  public ExceptionHandler getWrapped() {\r
-    return this.wrapped;\r
-  }\r
-\r
-  @Override\r
-  public void handle() throws FacesException {\r
-    for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) {\r
-      ExceptionQueuedEvent event = i.next();\r
-      ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();\r
-      Throwable t = context.getException();\r
-      if (t instanceof ViewExpiredException) {\r
-        // ViewExpiredException vee = (ViewExpiredException) t;\r
-        FacesContext fc = FacesContext.getCurrentInstance();\r
-        // Map<String, Object> requestMap = fc.getExternalContext().getRequestMap();\r
-        NavigationHandler nav = fc.getApplication().getNavigationHandler();\r
-        context.getContext().getPartialViewContext().setRenderAll(true);        \r
-        try {\r
-          nav.handleNavigation(fc, null, "search");\r
-          fc.renderResponse();\r
-        } finally {\r
-          i.remove();\r
-        }\r
-      }\r
-    }\r
-    getWrapped().handle();\r
-  }\r
-}\r
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 (file)
index ee60210..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.indexdata.pz2utils4jsf.exceptions;\r
-\r
-import javax.faces.context.ExceptionHandler;\r
-import javax.faces.context.ExceptionHandlerFactory;\r
-\r
-public class CustomExceptionHandlerFactory extends ExceptionHandlerFactory {\r
-\r
-  private ExceptionHandlerFactory parent;\r
-  \r
-  public CustomExceptionHandlerFactory (ExceptionHandlerFactory parent) {\r
-    this.parent = parent;\r
-  }\r
-  @Override\r
-  public ExceptionHandler getExceptionHandler() {\r
-    ExceptionHandler result = parent.getExceptionHandler();\r
-    result = new CustomExceptionHandler(result);\r
-    return result;\r
-  }\r
-\r
-}\r