Permalink
Browse files

Let exact mappings of FacesViews listen on forwarded requests too.

(useful in combination with URL rewrite filters)
  • Loading branch information...
1 parent 9803dad commit e0d8e0d79838221536e9efa8f718f6dee8b983cb @BalusC BalusC committed May 25, 2016
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/main/java/org/omnifaces/facesviews/FacesViews.java
@@ -37,6 +37,7 @@
import static org.omnifaces.util.Utils.startsWithOneOf;
import java.util.Collection;
+import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -46,6 +47,7 @@
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.webapp.FacesServlet;
+import javax.servlet.DispatcherType;
import javax.servlet.FilterRegistration;
import javax.servlet.ServletContext;
import javax.servlet.ServletRegistration;
@@ -239,7 +241,7 @@ public static void registerFilter(ServletContext servletContext) {
// Map the forwarding filter to all the resources we found.
for (String resource : collectedViews.keySet()) {
- facesViewsRegistration.addMappingForUrlPatterns(null, isFilterAfterDeclaredFilters(servletContext), resource);
+ facesViewsRegistration.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), isFilterAfterDeclaredFilters(servletContext), resource);
}
// Additionally map the filter to all paths that were scanned and which are also directly

0 comments on commit e0d8e0d

Please sign in to comment.